spec/spec_helper_spec.rb in watirsplash-0.1.9 vs spec/spec_helper_spec.rb in watirsplash-0.2.0
- old
+ new
@@ -1,7 +1,6 @@
-require "watirsplash"
-require "spec/autorun"
+require "spec"
describe WatirSplash::SpecHelper do
it "opens browser automatically" do
@browser.should exist
@@ -29,18 +28,18 @@
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 file_path methods without using formatter" do
+ it "has file_path methods formatter" do
file_name = "blah.temp"
ext = File.extname(file_name)
base = File.basename(file_name, ext)
- expected_path = File.join(Dir.pwd, "#{base}_\\d{6}#{ext}")
+ expected_path = File.join(Dir.pwd, "results/files/#{base}_.*#{ext}")
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("\\\\d\\{6\\}", "\\d{6}"))
+ native_file_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/misc/download.html"
\ No newline at end of file