Skip to content

Instantly share code, notes, and snippets.

@bakineggs
Created June 24, 2010 01:59
Show Gist options
  • Select an option

  • Save bakineggs/450865 to your computer and use it in GitHub Desktop.

Select an option

Save bakineggs/450865 to your computer and use it in GitHub Desktop.
class Selenium::WebDriver::Remote::DefaultHttpClient
def request_with_catch_timeout(*args)
begin
request_without_catch_timeout(*args)
rescue Timeout::Error # Timeout::Error.superclass == Interrupt, so rspec thinks its Ctrl-c and exits
raise Exception.new('request timeout') # Exception isn't a subclass of Interrupt so won't cause the whole test suite to exit
end
end
alias_method_chain :request, :catch_timeout
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment