aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_tmpdir.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-12 12:40:51 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-12 12:40:51 +0000
commit6f8bce9eff15b527c87e1b13312db2fbf0b504f4 (patch)
treefcccd01968dcae2fdc28486734447a1918815e77 /test/test_tmpdir.rb
parent0a577a1ce090c1661abfd74502e45aa13a488835 (diff)
downloadruby-6f8bce9eff15b527c87e1b13312db2fbf0b504f4.tar.gz
tmpdir.rb: not expand tilde
* lib/tmpdir.rb (Dir::Tmpname#create): deal with a prefix name which starts with tilde as a plain name, not expanding as home directory. [ruby-core:50793] [Bug #7547] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_tmpdir.rb')
-rw-r--r--test/test_tmpdir.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_tmpdir.rb b/test/test_tmpdir.rb
index c48b4b7fb2..61d3f60213 100644
--- a/test/test_tmpdir.rb
+++ b/test/test_tmpdir.rb
@@ -18,4 +18,15 @@ class TestTmpdir < Test::Unit::TestCase
end
end
end
+
+ def test_no_homedir
+ bug7547 = '[ruby-core:50793]'
+ home, ENV["HOME"] = ENV["HOME"], nil
+ dir = assert_nothing_raised(bug7547) do
+ break Dir.mktmpdir("~")
+ end
+ assert_match(/\A~/, File.basename(dir), bug7547)
+ ensure
+ ENV["HOME"] = home
+ end
end