From 05c108cdba62545bb50616726f0b7261cb89ad4e Mon Sep 17 00:00:00 2001 From: hsbt Date: Sun, 4 Jan 2015 00:18:38 +0000 Subject: * 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 --- test/test_tempfile.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') 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)) -- cgit v1.2.3