Skip to content

Commit

Permalink
ENV["HOME"] is prior as home on Windows
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
unak committed May 16, 2017
1 parent a540cec commit 6e7dfec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions spec/rubyspec/core/dir/home_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
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
Expand Down

0 comments on commit 6e7dfec

Please sign in to comment.