aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-29 03:57:15 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-29 03:57:15 +0000
commit952b218ffe78b7319c5e02887e7dd30d46dbc40e (patch)
tree14ee1d3c06e8b62196110501c1e03823c4064f07 /spec
parentf9dc0fb649e66cc0791d1b9c265644ed0fea82fa (diff)
downloadruby-952b218ffe78b7319c5e02887e7dd30d46dbc40e.tar.gz
spawn_spec.rb: add missing platform guard
this exists for `context "when passed close_others: false" do`, but this seems to be missing for `context "when passed close_others: true"`. And this seems to hang forever on Windows since r66622. https://ci.appveyor.com/project/ruby/ruby/builds/21277729 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec')
-rw-r--r--spec/ruby/core/process/spawn_spec.rb26
1 files changed, 14 insertions, 12 deletions
diff --git a/spec/ruby/core/process/spawn_spec.rb b/spec/ruby/core/process/spawn_spec.rb
index bbc8ceb1da..b8952c8488 100644
--- a/spec/ruby/core/process/spawn_spec.rb
+++ b/spec/ruby/core/process/spawn_spec.rb
@@ -537,19 +537,21 @@ describe "Process.spawn" do
@options = { close_others: true }
end
- it "closes file descriptors >= 3 in the child process even if fds are set close_on_exec=false" do
- touch @name
- IO.pipe do |r, w|
- r.close_on_exec = false
- w.close_on_exec = false
+ platform_is_not :windows do
+ it "closes file descriptors >= 3 in the child process even if fds are set close_on_exec=false" do
+ touch @name
+ IO.pipe do |r, w|
+ r.close_on_exec = false
+ w.close_on_exec = false
- begin
- pid = Process.spawn(ruby_cmd("while File.exist? '#{@name}'; sleep 0.1; end"), @options)
- w.close
- r.read(1).should == nil
- ensure
- rm_r @name
- Process.wait(pid) if pid
+ begin
+ pid = Process.spawn(ruby_cmd("while File.exist? '#{@name}'; sleep 0.1; end"), @options)
+ w.close
+ r.read(1).should == nil
+ ensure
+ rm_r @name
+ Process.wait(pid) if pid
+ end
end
end
end