aboutsummaryrefslogtreecommitdiffstats
path: root/test/reline/test_macro.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-06-03 03:38:39 +0900
committeraycabta <aycabta@gmail.com>2019-06-03 03:38:39 +0900
commit1bfba99b793e91f2d26af2ff7051a48f184f649e (patch)
tree7c670c33299dc576fbb4b1c52ace6112641d15f6 /test/reline/test_macro.rb
parent3428922437a31b644cffcabd33fd9353e68f88c8 (diff)
downloadruby-1bfba99b793e91f2d26af2ff7051a48f184f649e.tar.gz
Close leaked file descripters in tests
Diffstat (limited to 'test/reline/test_macro.rb')
-rw-r--r--test/reline/test_macro.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/reline/test_macro.rb b/test/reline/test_macro.rb
index 7d92b32cba..c69b50416a 100644
--- a/test/reline/test_macro.rb
+++ b/test/reline/test_macro.rb
@@ -5,7 +5,11 @@ class Reline::MacroTest < Reline::TestCase
@config = Reline::Config.new
@line_editor = Reline::LineEditor.new(@config)
@line_editor.instance_variable_set(:@screen_size, [24, 80])
- @line_editor.output = File.open(IO::NULL, "w")
+ @output = @line_editor.output = File.open(IO::NULL, "w")
+ end
+
+ def teardown
+ @output.close
end
def input_key(char, combined_char = char, with_meta = false)