summaryrefslogtreecommitdiff
path: root/test/psych/test_tainted.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/psych/test_tainted.rb')
-rw-r--r--test/psych/test_tainted.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/psych/test_tainted.rb b/test/psych/test_tainted.rb
index 62872b00e00..37fc5b2b803 100644
--- a/test/psych/test_tainted.rb
+++ b/test/psych/test_tainted.rb
@@ -117,14 +117,14 @@ module Psych
class TestIOTainted < TestStringTainted
def assert_taintedness string
- t = Tempfile.new(['something', 'yml'])
- t.binmode
- t.write string
- t.close
- File.open(t.path, 'r:bom|utf-8') { |f|
- @parser.parse f
+ Tempfile.create(['something', 'yml']) {|t|
+ t.binmode
+ t.write string
+ t.close
+ File.open(t.path, 'r:bom|utf-8') { |f|
+ @parser.parse f
+ }
}
- t.close(true)
end
end
end