diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-16 23:15:56 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-16 23:15:56 +0000 |
commit | 6e7dfec866e7f0856b82d5326d7a56b99f44483b (patch) | |
tree | 13a3f64f47529a5be836f05230c115d433679c41 | |
parent | a540cec9846bfde0e1220a47171919df2a6f803a (diff) | |
download | ruby-6e7dfec866e7f0856b82d5326d7a56b99f44483b.tar.gz |
ENV["HOME"] is prior as home on Windows
* spec/rubyspec/core/dir/home_spec.rb: ENV["HOME"] is prior as home on Windows.
reported by ko1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | spec/rubyspec/core/dir/home_spec.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/rubyspec/core/dir/home_spec.rb b/spec/rubyspec/core/dir/home_spec.rb index e1ebc3032e..6d99678034 100644 --- a/spec/rubyspec/core/dir/home_spec.rb +++ b/spec/rubyspec/core/dir/home_spec.rb @@ -5,8 +5,10 @@ describe "Dir.home" do it "returns the current user's home directory as a string if called without arguments" do home_directory = ENV['HOME'] platform_is :windows do - path = ENV['HOMEDRIVE'] + ENV['HOMEPATH'] - home_directory = path.tr('\\', '/').chomp('/') + unless home_directory + home_directory = ENV['HOMEDRIVE'] + ENV['HOMEPATH'] + end + home_directory = home_directory.tr('\\', '/').chomp('/') end Dir.home.should == home_directory |