Created
November 8, 2010 19:59
-
-
Save jarib/668173 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/spec/windows_spec.rb b/spec/windows_spec.rb | |
index c83a270..adb91a8 100644 | |
--- a/spec/windows_spec.rb | |
+++ b/spec/windows_spec.rb | |
@@ -1,4 +1,5 @@ | |
require File.expand_path('../spec_helper', __FILE__) | |
+require "socket" | |
if ChildProcess.windows? | |
describe ChildProcess::Windows::IO do | |
@@ -14,5 +15,20 @@ if ChildProcess.windows? | |
lambda { io.stdout = fake_io }.should raise_error(ArgumentError, /must have :fileno or :to_io/) | |
end | |
+ | |
+ end | |
+ | |
+ describe ChildProcess::Windows::Process do | |
+ it "does not inherit open sockets in from the parent when IO streams are inherited" do | |
+ server = TCPServer.new("localhost", 443322) | |
+ | |
+ process = sleeping_ruby | |
+ process.io.inherit! | |
+ | |
+ process.start | |
+ server.close | |
+ | |
+ lambda { TCPServer.new("localhost", 443322).close }.should_not raise_error | |
+ end | |
end | |
end | |
\ No newline at end of file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment