Permalink
Browse files

Remove Capybara.timeout entirely

  • Loading branch information...
1 parent 85b728e commit 6b1a8b61b8c3e05e30b817070a109254af128e97 @jnicklas jnicklas committed Feb 1, 2012
@@ -53,9 +53,4 @@ def wait?
def reset!
end
-
- def has_shortcircuit_timeout?
- false
- end
-
end
View
@@ -1,7 +1,6 @@
require 'uri'
require 'net/http'
require 'rack'
-require 'capybara/util/timeout'
module Capybara
class Server
View
@@ -1,5 +1,3 @@
-require 'capybara/util/timeout'
-
module Capybara
##
@@ -1,25 +0,0 @@
-module Capybara
- class << self
-
- ##
- # Provides timeout similar to standard library Timeout, but avoids threads
- #
- def timeout(seconds = 1, driver = nil, error_message = nil, &block)
- start_time = Time.now
-
- result = nil
-
- until result
- return result if result = yield
-
- delay = seconds - (Time.now - start_time)
- if delay <= 0
- raise TimeoutError, error_message || "timed out"
- end
-
- sleep(0.05)
- end
- end
-
- end
-end
View
@@ -28,4 +28,4 @@
module TestSessions
RackTest = Capybara::Session.new(:rack_test, TestApp)
Selenium = Capybara::Session.new(:selenium, TestApp)
-end
+end
View
@@ -1,28 +0,0 @@
-require 'spec_helper'
-
-require 'capybara'
-require 'capybara/util/timeout'
-
-module Capybara
-
- describe '.timeout' do
-
- it "should return result of yield if it returns true value within timeout" do
- Capybara.timeout { "hello" }.should == "hello"
- end
-
- it "should keep trying within timeout" do
- count = 0
- Capybara.timeout { count += 1; count == 5 ? count : nil }.should == 5
- end
-
- it "should raise Capybara::TimeoutError if block fails to return true within timeout" do
- running do
- Capybara.timeout(0.1) { false }
- end.should raise_error(::Capybara::TimeoutError)
- end
-
- end
-
-end
-

0 comments on commit 6b1a8b6

Please sign in to comment.