Bug #3317
closedtest/rake/test_win32.rb does strange tests and reports errors and failures
Description
=begin
See the results in the end of this message first.
1):
Why this test assume that ruby expands '~' even if ENV["HOME"] is not available?
All other platforms don't expand it in such case, same as ruby on Windows.
2):
Where this constant is defined?
3):
lib/rake/win32.rb sees ENV["AppData"] first, and only when it's not available,
sees ENV["HOME"].
Which is correct, implementation or this test?
4):
Combination of 1) and 3).
C:\ruby>ruby.exe -v test\rake\test_win32.rb
ruby 1.9.3dev (2010-05-19 trunk 27884) [i386-mswin32]
Loaded suite test/rake/test_win32
Started
EE.FF
Finished in 0.010000 seconds.
- 
Error: 
 test_win32_system_dir_fallback_to_userprofile_otherwise(Rake::TestWin32):
 ArgumentError: couldn't find HOME environment -- expanding~' test/rake/test_win32.rb:49:inblock in test_win32_system_dir_fallback_to_userprofile_otherwise'
 C:/ruby/test/rake/in_environment.rb:8:inin_environment' test/rake/test_win32.rb:47:intest_win32_system_dir_fallback_to_userprofile_otherwise'
- 
Error: 
 test_win32_system_dir_nil_of_no_env_vars(Rake::TestWin32):
 NameError: uninitialized constant Rake::Win32::Win32HomeError
 test/rake/test_win32.rb:62:inblock in test_win32_system_dir_nil_of_no_env_vars' C:/ruby/test/rake/in_environment.rb:8:inin_environment'
 test/rake/test_win32.rb:60:in `test_win32_system_dir_nil_of_no_env_vars'
- 
Failure: 
 test_win32_system_dir_uses_home_if_defined(Rake::TestWin32) [test/rake/test_win32.rb:13]:
 <"C:/HP/Rake"> expected but was
 <"C:/Users/usa/AppData/Roaming/Rake">.
- 
Failure: 
 test_win32_system_dir_uses_homedrive_homepath_when_no_home_defined(Rake::TestWin32) [test/rake/test_win32.rb:24]:
 <"C:/HP/Rake"> expected but was
 <"C:/Users/usa/AppData/Roaming/Rake">.
5 tests, 3 assertions, 2 failures, 2 errors, 0 skips
Test run options: --seed 59256
=end
        
           Updated by mame (Yusuke Endoh) over 15 years ago
          Updated by mame (Yusuke Endoh) over 15 years ago
          
          
        
        
      
      - Assignee set to nobu (Nobuyoshi Nakada)
=begin
Hi,
I guess all of these issues are caused by r21871 (by nobu).
Nobu, could you check this issue?
--
Yusuke Endoh mame@tsg.ne.jp
=end
        
           Updated by usa (Usaku NAKAMURA) over 15 years ago
          Updated by usa (Usaku NAKAMURA) over 15 years ago
          
          
        
        
      
      - Due date set to 06/30/2010
- Status changed from Open to Assigned
=begin
=end
        
           Updated by nobu (Nobuyoshi Nakada) over 15 years ago
          Updated by nobu (Nobuyoshi Nakada) over 15 years ago
          
          
        
        
      
      - Status changed from Assigned to Closed
- % Done changed from 0 to 100
=begin
This issue was solved with changeset r28145.
Usaku, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end