ruby-changes:46647
From: usa <ko1@a...>
Date: Wed, 17 May 2017 08:16:02 +0900 (JST)
Subject: [ruby-changes:46647] usa:r58763 (trunk): ENV["HOME"] is prior as home on Windows
usa 2017-05-17 08:15:56 +0900 (Wed, 17 May 2017) New Revision: 58763 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58763 Log: 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. Modified files: trunk/spec/rubyspec/core/dir/home_spec.rb Index: spec/rubyspec/core/dir/home_spec.rb =================================================================== --- spec/rubyspec/core/dir/home_spec.rb (revision 58762) +++ spec/rubyspec/core/dir/home_spec.rb (revision 58763) @@ -5,8 +5,10 @@ describe "Dir.home" do https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/dir/home_spec.rb#L5 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/