aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_tempfile.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-04 00:18:38 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-04 00:18:38 +0000
commit05c108cdba62545bb50616726f0b7261cb89ad4e (patch)
treefe832bc92dc43fa5422937f165d9632f5a977a9a /test/test_tempfile.rb
parentb85a4eea558368f68070c69b6ee482a77266ad96 (diff)
downloadruby-05c108cdba62545bb50616726f0b7261cb89ad4e.tar.gz
* lib/tempfile.rb: provide default basename parameter.
[fix GH-523] Patch by @dissolved * test/test_tempfile.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_tempfile.rb')
-rw-r--r--test/test_tempfile.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/test_tempfile.rb b/test/test_tempfile.rb
index 2fe62d37c5..6bba13473c 100644
--- a/test/test_tempfile.rb
+++ b/test/test_tempfile.rb
@@ -57,6 +57,11 @@ class TestTempfile < Test::Unit::TestCase
assert_match(/^foo/, File.basename(t.path))
end
+ def test_default_basename
+ t = tempfile
+ assert File.exist?(t.path)
+ end
+
def test_basename_with_suffix
t = tempfile(["foo", ".txt"])
assert_match(/^foo/, File.basename(t.path))