Don't run test which uses Kernel#fork on the Windows platform, where fork is not implemented.

This commit is contained in:
Jon Leighton 2011-05-23 23:46:39 +01:00
parent 97da26eef4
commit 6dc024fe26
1 changed files with 10 additions and 7 deletions

View File

@ -1,4 +1,5 @@
require 'spec_helper'
require 'rbconfig'
describe Capybara::Selenium::Driver do
before do
@ -13,14 +14,16 @@ describe Capybara::Selenium::Driver do
it_should_behave_like "driver without status code support"
it_should_behave_like "driver with cookies support"
it "should not interfere with forking child processes" do
# Launch a browser, which registers the at_exit hook
browser = Capybara::Selenium::Driver.new(TestApp).browser
unless Config::CONFIG['host_os'] =~ /mswin|mingw/
it "should not interfere with forking child processes" do
# Launch a browser, which registers the at_exit hook
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
# 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
browser.quit
browser.quit
end
end
end