Guard against fork being unavailable

Now the tests pass on all platforms on Travis.
This commit is contained in:
Jo Liss 2012-01-03 19:49:58 +01:00
parent 9e1600f022
commit 9f57b60c1c
1 changed files with 6 additions and 2 deletions

View File

@ -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