diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-04 15:44:56 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-04 15:44:56 +0000 |
commit | cf9ff56ac211b358b0a775b3367fd05a42b2f1fa (patch) | |
tree | 3dfd5480bc08c5a3b6aeea110d2f91e2e7d99bdb /test/test_tempfile.rb | |
parent | 2d09a53608524fd3bbc597080d9fd7b7c184e117 (diff) | |
download | ruby-cf9ff56ac211b358b0a775b3367fd05a42b2f1fa.tar.gz |
* test/test_tempfile.rb (test_{new,create}_traversal_dir): should not assume `t`
is always set. if `t` is nil, `NoMethodError` will be raised and the real
cause will be hidden.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_tempfile.rb')
-rw-r--r-- | test/test_tempfile.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test_tempfile.rb b/test/test_tempfile.rb index 6a8933c392..988dcf3a23 100644 --- a/test/test_tempfile.rb +++ b/test/test_tempfile.rb @@ -391,7 +391,7 @@ puts Tempfile.new('foo').path actual = Dir.glob(TRAVERSAL_PATH + '*').count assert_equal expect, actual ensure - t.close! + t&.close! end def test_create_traversal_dir @@ -400,6 +400,6 @@ puts Tempfile.new('foo').path actual = Dir.glob(TRAVERSAL_PATH + '*').count assert_equal expect, actual ensure - t.close + t&.close end end |