mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fix Leaked file descriptor in test/did_you_mean
de74d2c3b0/checks (step)
:19:131
```
Leaked file descriptor: NameErrorExtensionTest#test_correctable_error_objects_are_dumpable: 7 : #<File:test_name_error_extension.rb>
```
This commit is contained in:
parent
185f760873
commit
1a88adcd75
Notes:
git
2019-12-02 16:26:09 +09:00
1 changed files with 2 additions and 2 deletions
|
@ -35,14 +35,14 @@ class NameErrorExtensionTest < Test::Unit::TestCase
|
||||||
def test_correctable_error_objects_are_dumpable
|
def test_correctable_error_objects_are_dumpable
|
||||||
error =
|
error =
|
||||||
begin
|
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
|
rescue NoMethodError => e
|
||||||
e
|
e
|
||||||
end
|
end
|
||||||
|
|
||||||
error.to_s
|
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
|
Marshal.load(Marshal.dump(error)).original_message
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue