aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-10-12 19:05:18 +0900
committergit <svn-admin@ruby-lang.org>2021-10-12 19:11:56 +0900
commit97302a362b75aef8e8ef14afe0c9803a4aa00ec9 (patch)
treed786cce8aeb3212a611496989decb87b205b3114
parentf310c19544ca2bf1805edcb83a15ae49817259b3 (diff)
downloadruby-97302a362b75aef8e8ef14afe0c9803a4aa00ec9.tar.gz
[ruby/reline] Close working pipes
https://github.com/ruby/reline/commit/ac519f57ea
-rw-r--r--test/reline/test_reline.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/reline/test_reline.rb b/test/reline/test_reline.rb
index 89903ecbe5..3e5ad2f874 100644
--- a/test/reline/test_reline.rb
+++ b/test/reline/test_reline.rb
@@ -280,14 +280,19 @@ class Reline::Test < Reline::TestCase
assert_raise(TypeError) do
Reline.output = "This is not a file."
end
- Reline.input, to_write = IO.pipe
- to_read, Reline.output = IO.pipe
+ input, to_write = IO.pipe
+ to_read, output = IO.pipe
+ Reline.input, Reline.output = input, output
to_write.write "a\n"
result = Reline.readline
to_write.close
read_text = to_read.read_nonblock(100)
assert_equal('a', result)
refute(read_text.empty?)
+ ensure
+ input&.close
+ output&.close
+ to_read&.close
end
def test_vi_editing_mode