diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-04 00:18:38 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-04 00:18:38 +0000 |
commit | 05c108cdba62545bb50616726f0b7261cb89ad4e (patch) | |
tree | fe832bc92dc43fa5422937f165d9632f5a977a9a /test/test_tempfile.rb | |
parent | b85a4eea558368f68070c69b6ee482a77266ad96 (diff) |
* 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.rb | 5 |
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)) |