spec/spec_helper_spec.rb in watirsplash-0.2.5 vs spec/spec_helper_spec.rb in watirsplash-0.2.6

- old
+ new

@@ -7,54 +7,31 @@ @browser.url.should == "about:blank" @browser.title.should == "" end it "redirects method calls to Watir::Browser" do - goto "http://google.com" - url.should =~ /google/ - title.should =~ /google/i - text_field = text_field(:name => "q") + goto "http://dl.dropbox.com/u/2731643/WatirSplash/test.html" + url.should =~ /test/ + title.should == "WatirSplash testing page" + text_field = text_field(:name => "field1") text_field.should exist text_field.should be_visible + text_field.value == "empty value" end - it "has wait_until" do - lambda {wait_until(0.5) {sleep 0.1; true}}.should_not raise_exception - lambda {wait_until(0.5) {sleep 0.1; false}}.should raise_exception(Watir::Exception::TimeOutException) - end - - it "has wait_until?" do - result = wait_until? {sleep 0.1; true} - result.should be_true - - result = wait_until?(0.5) {sleep 0.1; false} - result.should be_false - end - - it "has file_path methods" do + it "has File.path and File.native_path methods" do file_name = "blah.temp" ext = File.extname(file_name) base = File.basename(file_name, ext) expected_path = File.join(Dir.pwd, "results/files/#{base}_.*#{ext}") - file_path(file_name).should =~ Regexp.new(expected_path) + File.path(file_name).should =~ Regexp.new(expected_path) expected_path = expected_path.gsub("/", "\\") - native_file_path(file_path(file_name)).should =~ Regexp.new(Regexp.escape(expected_path).gsub("\\.\\*", ".*")) + File.native_path(File.path(file_name)).should =~ Regexp.new(Regexp.escape(expected_path).gsub("\\.\\*", ".*")) end - it "has download_file method" do - begin - goto "http://dl.dropbox.com/u/2731643/WatirSplash/download.html" - link(:text => "Download").click_no_wait - file = download_file("download.zip") - File.read(file).should == "this is a 'zip' file!" - ensure - FileUtils.rm file - end - end - it "redirects usages of method 'p' to Watir::IE#p instead of Kernel.p" do - goto "http://dl.dropbox.com/u/2731643/WatirSplash/elements.html" + goto "http://dl.dropbox.com/u/2731643/WatirSplash/test.html" paragraph = p(:class => "my_pg") paragraph.should exist paragraph.text.should == "This is a paragraph!" end \ No newline at end of file