Permalink
Browse files

Replace Capybara::TimeoutError with Timeout::Error

Capybara::TimeoutError has been removed.
  • Loading branch information...
1 parent 59ca3c9 commit 3dfcf460572519d8878e921af057b15942d5e45c @mhoran mhoran committed Jan 3, 2013
Showing with 11 additions and 11 deletions.
  1. +1 −1 lib/capybara/webkit/browser.rb
  2. +10 −10 spec/driver_spec.rb
@@ -200,7 +200,7 @@ def check
elsif result != 'ok'
case response = read_response
when "timeout"
- raise Capybara::TimeoutError, "Request timed out after #{timeout_seconds}"
+ raise Timeout::Error, "Request timed out after #{timeout_seconds}"
else
raise InvalidResponseError, response
end
View
@@ -1947,13 +1947,13 @@ def which_for(character)
it "returns 401 for incorrectly authenticated request" do
driver.browser.authenticate('user1', 'password1')
driver.browser.timeout = 2
- lambda { visit("/") }.should_not raise_error(Capybara::TimeoutError)
+ lambda { visit("/") }.should_not raise_error(Timeout::Error)
driver.status_code.should == 401
end
it "returns 401 for unauthenticated request" do
driver.browser.timeout = 2
- lambda { visit("/") }.should_not raise_error(Capybara::TimeoutError)
+ lambda { visit("/") }.should_not raise_error(Timeout::Error)
driver.status_code.should == 401
end
end
@@ -2059,32 +2059,32 @@ def which_for(character)
it "should not raise a timeout error when zero" do
driver.browser.timeout = 0
- lambda { visit("/") }.should_not raise_error(Capybara::TimeoutError)
+ lambda { visit("/") }.should_not raise_error(Timeout::Error)
end
it "should raise a timeout error" do
driver.browser.timeout = 1
- lambda { visit("/") }.should raise_error(Capybara::TimeoutError, "Request timed out after 1 second")
+ lambda { visit("/") }.should raise_error(Timeout::Error, "Request timed out after 1 second")
end
it "should not raise an error when the timeout is high enough" do
driver.browser.timeout = 10
- lambda { visit("/") }.should_not raise_error(Capybara::TimeoutError)
+ lambda { visit("/") }.should_not raise_error(Timeout::Error)
end
it "should set the timeout for each request" do
driver.browser.timeout = 10
- lambda { visit("/") }.should_not raise_error(Capybara::TimeoutError)
+ lambda { visit("/") }.should_not raise_error(Timeout::Error)
driver.browser.timeout = 1
- lambda { visit("/") }.should raise_error(Capybara::TimeoutError)
+ lambda { visit("/") }.should raise_error(Timeout::Error)
end
it "should set the timeout for each request" do
driver.browser.timeout = 1
- lambda { visit("/") }.should raise_error(Capybara::TimeoutError)
+ lambda { visit("/") }.should raise_error(Timeout::Error)
driver.reset!
driver.browser.timeout = 10
- lambda { visit("/") }.should_not raise_error(Capybara::TimeoutError)
+ lambda { visit("/") }.should_not raise_error(Timeout::Error)
end
it "should raise a timeout on a slow form" do
@@ -2093,7 +2093,7 @@ def which_for(character)
driver.status_code.should == 200
driver.browser.timeout = 1
driver.find("//input").first.click
- lambda { driver.status_code }.should raise_error(Capybara::TimeoutError)
+ lambda { driver.status_code }.should raise_error(Timeout::Error)
end
it "get timeout" do

0 comments on commit 3dfcf46

Please sign in to comment.