summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorsonots <sonots@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-26 05:45:29 +0000
committersonots <sonots@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-26 05:45:29 +0000
commit64f53f0dbfd103d3c0d5c567a849251ce6466086 (patch)
tree82cda88d035d017d0ff9427f8b65d250f2826137 /test
parent8d501ec021010dbfdd29d92155bebd82960ad1f1 (diff)
* lib/tempfile.rb: provide default basename parameter
for Tempfile.create. [Feature #11965] Patch by Yuki Kurihara * test/test_tempfile.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/test_tempfile.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_tempfile.rb b/test/test_tempfile.rb
index 8147d93f85..cd2828df37 100644
--- a/test/test_tempfile.rb
+++ b/test/test_tempfile.rb
@@ -345,5 +345,14 @@ puts Tempfile.new('foo').path
f.close if f && !f.closed?
File.unlink path if path
end
+
+ def test_create_default_basename
+ path = nil
+ Tempfile.create {|f|
+ path = f.path
+ assert_file.exist?(path)
+ }
+ assert_file.not_exist?(path)
+ end
end