From 00cec74ed7d15636dc5788a6ac8fc9fc9ea76dda Mon Sep 17 00:00:00 2001 From: randoum Date: Thu, 23 May 2013 19:06:05 +0800 Subject: [PATCH] Avoid NoMethodError when calling Capybara::Selenium::Driver#quit and driver was not started --- lib/capybara/selenium/driver.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/capybara/selenium/driver.rb b/lib/capybara/selenium/driver.rb index 9941eeaf..2345db0b 100644 --- a/lib/capybara/selenium/driver.rb +++ b/lib/capybara/selenium/driver.rb @@ -137,7 +137,7 @@ class Capybara::Selenium::Driver < Capybara::Driver::Base end def quit - @browser.quit + @browser.quit if @browser rescue Errno::ECONNREFUSED # Browser must have already gone end