spec/rspec_patches_spec.rb in watirsplash-2.4.2 vs spec/rspec_patches_spec.rb in watirsplash-2.4.3

- old
+ new

@@ -3,27 +3,10 @@ before :each do goto "http://dl.dropbox.com/u/2731643/WatirSplash/test.html" end context "RSpec::Matchers" do - context "Array#match_array" do - it "matches other arrays with regexps" do - expected_ary = ["1", "2", "3", /\d/] - ["1", "2", "3", "5"].should match_array(expected_ary) - - expected_ary = ["1", ["2", /\d+/], /3/] - ["1", [], "4"].should_not match_array(expected_ary) - ["1", ["2", "55"], "3"].should match_array(expected_ary) - end - - it "doesn't work with other objects except Array" do - lambda {"".should match_array("")}.should raise_exception - lambda {[].should match_array("")}.should raise_exception - lambda {"".should match_array([])}.should raise_exception - end - end - context "#within" do it "can be used with #change" do div(:id => "div2").text.should == "Div is shown" t = Time.now @@ -170,11 +153,11 @@ end end context "#soon" do it "is an alias for #within(30)" do - RSpec::Matchers::Matcher.new(nil) {}.soon.instance_variable_get(:@within_timeout).should == 30 + RSpec::Matchers::DSL::Matcher.new(nil) {}.soon.instance_variable_get(:@within_timeout).should == 30 end end context "#make" do it "is an alias for #change" do @@ -184,28 +167,28 @@ end end context "#seconds" do it "is for syntactic sugar" do - RSpec::Matchers::Matcher.new(nil) {}.within(2).seconds.instance_variable_get(:@within_timeout).should == 2 - RSpec::Matchers::Matcher.new(nil) {}.during(3).seconds.instance_variable_get(:@during_timeout).should == 3 + RSpec::Matchers::DSL::Matcher.new(nil) {}.within(2).seconds.instance_variable_get(:@within_timeout).should == 2 + RSpec::Matchers::DSL::Matcher.new(nil) {}.during(3).seconds.instance_variable_get(:@during_timeout).should == 3 end it "has #second as an alias" do - RSpec::Matchers::Matcher.new(nil) {}.within(1).second.instance_variable_get(:@within_timeout).should == 1 - RSpec::Matchers::Matcher.new(nil) {}.during(2).second.instance_variable_get(:@during_timeout).should == 2 + RSpec::Matchers::DSL::Matcher.new(nil) {}.within(1).second.instance_variable_get(:@within_timeout).should == 1 + RSpec::Matchers::DSL::Matcher.new(nil) {}.during(2).second.instance_variable_get(:@during_timeout).should == 2 end end context "#minutes" do it "converts timeout into minutes" do - RSpec::Matchers::Matcher.new(nil) {}.within(2).minutes.instance_variable_get(:@within_timeout).should == 2*60 - RSpec::Matchers::Matcher.new(nil) {}.during(3).minutes.instance_variable_get(:@during_timeout).should == 3*60 + RSpec::Matchers::DSL::Matcher.new(nil) {}.within(2).minutes.instance_variable_get(:@within_timeout).should == 2*60 + RSpec::Matchers::DSL::Matcher.new(nil) {}.during(3).minutes.instance_variable_get(:@during_timeout).should == 3*60 end it "has #minute as an alias" do - RSpec::Matchers::Matcher.new(nil) {}.within(1).minute.instance_variable_get(:@within_timeout).should == 1*60 - RSpec::Matchers::Matcher.new(nil) {}.during(2).minute.instance_variable_get(:@during_timeout).should == 2*60 + RSpec::Matchers::DSL::Matcher.new(nil) {}.within(1).minute.instance_variable_get(:@within_timeout).should == 1*60 + RSpec::Matchers::DSL::Matcher.new(nil) {}.during(2).minute.instance_variable_get(:@during_timeout).should == 2*60 end end end end