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:
parent
bed6b7206a
commit
ca6868a430
1 changed files with 5 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue