summaryrefslogtreecommitdiff
path: root/test/did_you_mean
diff options
context:
space:
mode:
authorKazuhiro NISHIYAMA <zn@mbf.nifty.com>2019-12-02 15:21:15 +0900
committerKazuhiro NISHIYAMA <znz@users.noreply.github.com>2019-12-02 16:25:43 +0900
commit1a88adcd75d92cb36ef5b1d5f4aeb40e6fe4dcb7 (patch)
treef8906454930feec96726679e9f67a215d1f12145 /test/did_you_mean
parent185f7608737a550a0891a7fc5a6a4ee32721bce3 (diff)
Fix Leaked file descriptor in test/did_you_mean
https://github.com/ruby/ruby/commit/de74d2c3b0005048a2c4433bde68b9be10c86f01/checks?check_suite_id=336910877#step:19:131 ``` Leaked file descriptor: NameErrorExtensionTest#test_correctable_error_objects_are_dumpable: 7 : #<File:test_name_error_extension.rb> ```
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2712
Diffstat (limited to 'test/did_you_mean')
-rw-r--r--test/did_you_mean/core_ext/test_name_error_extension.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/did_you_mean/core_ext/test_name_error_extension.rb b/test/did_you_mean/core_ext/test_name_error_extension.rb
index dc571a8..9dc08db 100644
--- a/test/did_you_mean/core_ext/test_name_error_extension.rb
+++ b/test/did_you_mean/core_ext/test_name_error_extension.rb
@@ -35,14 +35,14 @@ class NameErrorExtensionTest < Test::Unit::TestCase
def test_correctable_error_objects_are_dumpable
error =
begin
- Dir.chdir(__dir__) { File.open('test_name_error_extension.rb').sizee }
+ Dir.chdir(__dir__) { File.open('test_name_error_extension.rb') { |f| f.sizee } }
rescue NoMethodError => e
e
end
error.to_s
- assert_equal "undefined method `sizee' for #<File:test_name_error_extension.rb>",
+ assert_equal "undefined method `sizee' for #<File:test_name_error_extension.rb (closed)>",
Marshal.load(Marshal.dump(error)).original_message
end
end