Skip to content

Commit

Permalink
made tests cleaner and better coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
gaffo committed Jun 4, 2009
1 parent 977f643 commit e46df8c
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions spec/public/selenium/selenium_session_spec.rb
Expand Up @@ -20,9 +20,29 @@
@selenium.yieldable_exceptions.should == [::Spec::Expectations::ExpectationNotMetError, ::Selenium::CommandError, Webrat::WebratError]
end

it "should handle yieldable exceptions in the wait_for" do
it "should throw timeout instead of spec expectionnotmet error" do
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
end
fail("didn't throw")
Expand Down

0 comments on commit e46df8c

Please sign in to comment.