Use File.expand_path("~username") instead of ENV["HOME"]
File.expand_path("~username") uses getpwnam() independently from Dir.home. [Bug #15324] From: Chris Seaton <chris@chrisseaton.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0bd8193eba
commit
4e1ee66580
@ -374,8 +374,7 @@ class TestDir < Test::Unit::TestCase
|
|||||||
assert_equal(@nodir, Dir.home)
|
assert_equal(@nodir, Dir.home)
|
||||||
assert_equal(@nodir, Dir.home(""))
|
assert_equal(@nodir, Dir.home(""))
|
||||||
if user = ENV["USER"]
|
if user = ENV["USER"]
|
||||||
ENV["HOME"] = env_home
|
assert_equal(File.expand_path("~#{user}"), Dir.home(user))
|
||||||
assert_equal(File.expand_path(env_home), Dir.home(user))
|
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
%W[no:such:user \u{7559 5b88}:\u{756a}].each do |user|
|
%W[no:such:user \u{7559 5b88}:\u{756a}].each do |user|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user