1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Do "write" to temp stdin before "reopen"

This commit is contained in:
aycabta 2020-08-19 09:42:34 +09:00
parent bed6b7206a
commit ca6868a430

View file

@ -116,14 +116,14 @@ module TestIRB
end
with_temp_stdio do |stdin, stdout|
yield(stdin, stdout)
stdin.close
stdout.flush
replace_stdio(stdin.path, stdout.path) do
yield(stdin, stdout)
stdin.close
system('ruby', '-Ilib', '-Itest', '-W0', '-rirb', '-e', 'IRB.start(__FILE__)')
stdout.flush
result = stdout.read
stdout.close
end
result = stdout.read
stdout.close
end
open(IRB.rc_file("_history"), "r") do |f|
result_history = f.read