summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-25 16:33:57 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-25 16:33:57 +0000
commitf86be91b56c39808ca71056f40e4cf1c786c89b3 (patch)
treea1c8edc9c575aed842f2f49e98ce4f32ad21ca87 /test
parent044e75db6d810dece06d8a7921aae18a6024faa8 (diff)
* file.c (rb_file_expand_path_internal): fix r42160; skip '~'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_file_exhaustive.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index 219d357cf2..2e563e53a8 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -669,6 +669,11 @@ class TestFileExhaustive < Test::Unit::TestCase
assert_raise(ArgumentError, bug) { File.expand_path("~anything") }
end if DRIVE
+ def test_expand_path_for_existent_username
+ user = ENV['USER']
+ assert_equal(ENV['HOME'], File.expand_path("~#{user}"))
+ end unless DRIVE
+
def test_expand_path_error_for_nonexistent_username
user = "\u{3086 3046 3066 3044}:\u{307F 3084 304A 3046}"
assert_raise_with_message(ArgumentError, /#{user}/) {File.expand_path("~#{user}")}