From 9f57b60c1c6cd2c45da283c48972abe241af1c48 Mon Sep 17 00:00:00 2001 From: Jo Liss Date: Tue, 3 Jan 2012 19:49:58 +0100 Subject: [PATCH] Guard against fork being unavailable Now the tests pass on all platforms on Travis. --- spec/driver/selenium_driver_spec.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/driver/selenium_driver_spec.rb b/spec/driver/selenium_driver_spec.rb index d7a31765..032a18d5 100644 --- a/spec/driver/selenium_driver_spec.rb +++ b/spec/driver/selenium_driver_spec.rb @@ -20,8 +20,12 @@ describe Capybara::Selenium::Driver do browser = Capybara::Selenium::Driver.new(TestApp).browser # Fork an unrelated child process. This should not run the code in the at_exit hook. - pid = fork { "child" } - Process.wait2(pid)[1].exitstatus.should == 0 + begin + pid = fork { "child" } + Process.wait2(pid)[1].exitstatus.should == 0 + rescue NotImplementedError + # Fork unsupported (e.g. on JRuby) + end browser.quit end