diff options
Diffstat (limited to 'spec/rubyspec/core/dir/home_spec.rb')
-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 |