summaryrefslogtreecommitdiff
path: root/test/irb/test_history.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/irb/test_history.rb')
-rw-r--r--test/irb/test_history.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/irb/test_history.rb b/test/irb/test_history.rb
index 0b3620fe32..f9193e553a 100644
--- a/test/irb/test_history.rb
+++ b/test/irb/test_history.rb
@@ -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