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

View File

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