summaryrefslogtreecommitdiff
path: root/spec/ruby
diff options
context:
space:
mode:
authorLars Kanis <lars@greiz-reinsdorf.de>2022-12-27 00:34:29 +0100
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-10-26 19:00:54 +0900
commit73d7fd8614e6ef3f55911932af96da908aa04bf8 (patch)
treece953377bd6c2b258066cf69f539ca1dd42d39ff /spec/ruby
parente74ea904ad29931c476b3af493e3ee089f5b4afa (diff)
Windows: Prefer USERPROFILE over HOMEPATH
Enable the test commented out in ruby/ruby@d0f5dc9eac78ecade459. Extracted from GH-7033, that is for initialization at start up time and this test is unrelated to it.
Diffstat (limited to 'spec/ruby')
-rw-r--r--spec/ruby/core/dir/home_spec.rb27
1 files changed, 13 insertions, 14 deletions
diff --git a/spec/ruby/core/dir/home_spec.rb b/spec/ruby/core/dir/home_spec.rb
index 90a008faf1..3cf745ab46 100644
--- a/spec/ruby/core/dir/home_spec.rb
+++ b/spec/ruby/core/dir/home_spec.rb
@@ -40,22 +40,21 @@ describe "Dir.home" do
home.should == "C:/rubyspäc/home"
home.encoding.should == Encoding::UTF_8
end
- end
- it "retrieves the directory from HOME, USERPROFILE, HOMEDRIVE/HOMEPATH and the WinAPI in that order" do
- old_dirs = [ENV.delete('HOME'), ENV.delete('USERPROFILE'), ENV.delete('HOMEDRIVE'), ENV.delete('HOMEPATH')]
+ it "retrieves the directory from HOME, USERPROFILE, HOMEDRIVE/HOMEPATH and the WinAPI in that order" do
+ old_dirs = [ENV.delete('HOME'), ENV.delete('USERPROFILE'), ENV.delete('HOMEDRIVE'), ENV.delete('HOMEPATH')]
- Dir.home.should == old_dirs[1].gsub("\\", "/")
- ENV['HOMEDRIVE'] = "C:"
- ENV['HOMEPATH'] = "\\rubyspec\\home1"
- Dir.home.should == "C:/rubyspec/home1"
- ENV['USERPROFILE'] = "C:\\rubyspec\\home2"
- # https://bugs.ruby-lang.org/issues/19244
- # Dir.home.should == "C:/rubyspec/home2"
- ENV['HOME'] = "C:\\rubyspec\\home3"
- Dir.home.should == "C:/rubyspec/home3"
- ensure
- ENV['HOME'], ENV['USERPROFILE'], ENV['HOMEDRIVE'], ENV['HOMEPATH'] = *old_dirs
+ Dir.home.should == old_dirs[1].gsub("\\", "/")
+ ENV['HOMEDRIVE'] = "C:"
+ ENV['HOMEPATH'] = "\\rubyspec\\home1"
+ Dir.home.should == "C:/rubyspec/home1"
+ ENV['USERPROFILE'] = "C:\\rubyspec\\home2"
+ Dir.home.should == "C:/rubyspec/home2"
+ ENV['HOME'] = "C:\\rubyspec\\home3"
+ Dir.home.should == "C:/rubyspec/home3"
+ ensure
+ ENV['HOME'], ENV['USERPROFILE'], ENV['HOMEDRIVE'], ENV['HOMEPATH'] = *old_dirs
+ end
end
end
end