1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Remove unneeded begin and end

This commit is contained in:
Kazuhiro NISHIYAMA 2020-09-30 15:55:07 +09:00
parent 30bb040ea4
commit ce986b41ca
No known key found for this signature in database
GPG key ID: 262ED8DBB4222F7A

View file

@ -160,12 +160,10 @@ class JSONCommonInterfaceTest < Test::Unit::TestCase
def temp_file_containing(text, file_prefix = '') def temp_file_containing(text, file_prefix = '')
raise "This method must be called with a code block." unless block_given? raise "This method must be called with a code block." unless block_given?
begin Tempfile.create(file_prefix) do |file|
Tempfile.create(file_prefix) do |file| file << text
file << text file.close
file.close yield file.path
yield file.path
end
end end
end end
end end