made tests cleaner and better coverage
This commit is contained in:
parent
977f643dca
commit
e46df8c6f9
|
@ -20,9 +20,29 @@ describe Webrat::SeleniumSession do
|
||||||
@selenium.yieldable_exceptions.should == [::Spec::Expectations::ExpectationNotMetError, ::Selenium::CommandError, Webrat::WebratError]
|
@selenium.yieldable_exceptions.should == [::Spec::Expectations::ExpectationNotMetError, ::Selenium::CommandError, Webrat::WebratError]
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should handle yieldable exceptions in the wait_for" do
|
it "should throw timeout instead of spec expectionnotmet error" do
|
||||||
begin
|
begin
|
||||||
@selenium.wait_for(:timeout => 0.25) do
|
@selenium.wait_for(:timeout => 0.1) do
|
||||||
|
raise ::Spec::Expectations::ExpectationNotMetError
|
||||||
|
end
|
||||||
|
fail("didn't throw")
|
||||||
|
rescue Webrat::TimeoutError
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should throw timeout instead of selenium command error" do
|
||||||
|
begin
|
||||||
|
@selenium.wait_for(:timeout => 0.1) do
|
||||||
|
raise ::Selenium::CommandError
|
||||||
|
end
|
||||||
|
fail("didn't throw")
|
||||||
|
rescue Webrat::TimeoutError
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should throw timeout instead of webrat error" do
|
||||||
|
begin
|
||||||
|
@selenium.wait_for(:timeout => 0.1) do
|
||||||
raise Webrat::WebratError.new
|
raise Webrat::WebratError.new
|
||||||
end
|
end
|
||||||
fail("didn't throw")
|
fail("didn't throw")
|
||||||
|
|
Loading…
Reference in New Issue