Skip to content

Commit

Permalink
Don't run test which uses Kernel#fork on the Windows platform, where …
Browse files Browse the repository at this point in the history
…fork is not implemented.
  • Loading branch information
jonleighton committed May 23, 2011
1 parent 97da26e commit 6dc024f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions spec/driver/selenium_driver_spec.rb
@@ -1,4 +1,5 @@
require 'spec_helper'
require 'rbconfig'

describe Capybara::Selenium::Driver do
before do
Expand All @@ -13,14 +14,16 @@
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

0 comments on commit 6dc024f

Please sign in to comment.