summaryrefslogtreecommitdiff
path: root/test/ruby/test_file_exhaustive.rb
diff options
context:
space:
mode:
authorluislavena <luislavena@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-10 14:39:09 +0000
committerluislavena <luislavena@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-10 14:39:09 +0000
commitee90455a447aaafe1985ba365d0357ba8f524146 (patch)
tree877420f0bdd1055f92f4b25f8e2d0f70dc425531 /test/ruby/test_file_exhaustive.rb
parent4cbb8ea83650af5de9f058955f6ef7f713b0977f (diff)
Expand home directory when used in dir_string
* win32/file.c (rb_file_expand_path_internal): Expand home directory when used as second parameter (dir_string). [ruby-core:53168] [Bug #8034] * test/ruby/test_file_exhaustive.rb: add test to verify. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_file_exhaustive.rb')
-rw-r--r--test/ruby/test_file_exhaustive.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index 360a1c7cce..25cb92ea36 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -502,6 +502,18 @@ class TestFileExhaustive < Test::Unit::TestCase
end
end
+ def test_expand_path_home_dir_string
+ home = ENV["HOME"]
+ new_home = "#{DRIVE}/UserHome"
+ ENV["HOME"] = new_home
+ bug8034 = "[ruby-core:53168]"
+
+ assert_equal File.join(new_home, "foo"), File.expand_path("foo", "~")
+ assert_equal File.join(new_home, "bar", "foo"), File.expand_path("foo", "~/bar")
+ ensure
+ ENV["HOME"] = home
+ end if DRIVE
+
def test_expand_path_remove_trailing_alternative_data
assert_equal File.join(@rootdir, "aaa"), File.expand_path("#{@rootdir}/aaa::$DATA")
assert_equal File.join(@rootdir, "aa:a"), File.expand_path("#{@rootdir}/aa:a:$DATA")