refactored tests to be more rspeccy

This commit is contained in:
Mike Gaffney 2009-06-04 14:24:17 -05:00
parent f3a12adaa9
commit 6816c46d47
1 changed files with 6 additions and 12 deletions

View File

@ -21,33 +21,27 @@ describe Webrat::SeleniumSession do
end
it "should throw timeout instead of spec expectionnotmet error" do
begin
lambda {
@selenium.wait_for(:timeout => 0.1) do
raise ::Spec::Expectations::ExpectationNotMetError
end
fail("didn't throw")
rescue Webrat::TimeoutError
end
}.should raise_error(Webrat::TimeoutError)
end
it "should throw timeout instead of selenium command error" do
begin
lambda {
@selenium.wait_for(:timeout => 0.1) do
raise ::Selenium::CommandError
end
fail("didn't throw")
rescue Webrat::TimeoutError
end
}.should raise_error(Webrat::TimeoutError)
end
it "should throw timeout instead of webrat error" do
begin
lambda {
@selenium.wait_for(:timeout => 0.1) do
raise Webrat::WebratError.new
end
fail("didn't throw")
rescue Webrat::TimeoutError
end
}.should raise_error(Webrat::TimeoutError)
end
end