aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-16 23:15:56 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-16 23:15:56 +0000
commit3482391ba1b5838ecbe93d708aa2eff6514a18a8 (patch)
tree13a3f64f47529a5be836f05230c115d433679c41 /spec
parent0a35a76b9f694e89b28b8ebaea59755d4c9db2cd (diff)
downloadruby-3482391ba1b5838ecbe93d708aa2eff6514a18a8.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
Diffstat (limited to 'spec')
-rw-r--r--spec/rubyspec/core/dir/home_spec.rb6
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