Skip to content

Commit 74e3985

Browse files
committed
Pass IOs as separate list for ruby 2.x
1 parent e4b0b0e commit 74e3985

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

test/lib/core_assertions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def assert_separately(args, file = nil, line = nil, src, ignore_stderr: nil, **o
278278
capture_stdout = false
279279
opt[:out] = MiniTest::Unit.output if defined?(MiniTest::Unit)
280280
res_p, res_c = IO.pipe
281-
opt[res_c.fileno] = res_c.fileno
281+
opt[:ios] = [res_c]
282282
end
283283
src = <<eom
284284
# -*- coding: #{line += __LINE__; src.encoding}; -*-

test/lib/envutil.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def terminate(pid, signal = :TERM, pgroup = nil, reprieve = 1)
125125

126126
def invoke_ruby(args, stdin_data = "", capture_stdout = false, capture_stderr = false,
127127
encoding: nil, timeout: 10, reprieve: 1, timeout_error: Timeout::Error,
128-
stdout_filter: nil, stderr_filter: nil,
128+
stdout_filter: nil, stderr_filter: nil, ios: nil,
129129
signal: :TERM,
130130
rubybin: EnvUtil.rubybin, precommand: nil,
131131
**opt)
@@ -141,6 +141,8 @@ def invoke_ruby(args, stdin_data = "", capture_stdout = false, capture_stderr =
141141
out_p.set_encoding(encoding) if out_p
142142
err_p.set_encoding(encoding) if err_p
143143
end
144+
ios.each {|i, o = i|opt[i] = o} if ios
145+
144146
c = "C"
145147
child_env = {}
146148
LANG_ENVS.each {|lc| child_env[lc] = c}
@@ -152,7 +154,7 @@ def invoke_ruby(args, stdin_data = "", capture_stdout = false, capture_stderr =
152154
end
153155
child_env['ASAN_OPTIONS'] = ENV['ASAN_OPTIONS'] if ENV['ASAN_OPTIONS']
154156
args = [args] if args.kind_of?(String)
155-
pid = spawn(child_env, *precommand, rubybin, *args, **opt)
157+
pid = spawn(child_env, *precommand, rubybin, *args, opt)
156158
in_c.close
157159
out_c&.close
158160
out_c = nil

0 commit comments

Comments
 (0)