Skip to content

Commit

Permalink
refactored tests to be more rspeccy
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Gaffney committed Jun 4, 2009
1 parent f3a12ad commit 6816c46
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions spec/public/selenium/selenium_session_spec.rb
Expand Up @@ -21,33 +21,27 @@
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

0 comments on commit 6816c46

Please sign in to comment.