From: Charlie Savage Date: 2009-03-28T17:34:51+09:00 Subject: [ruby-core:23042] [Bug #1266] relative_path broken on windows Issue #1266 has been updated by Charlie Savage. File pathname.patch added I was hoping we could raise the priority of this issue. This bug prevents Ruby's test suite from being run at all on windows: :\Development\src\ruby_trunk\test>ruby runner.rb minitest\test_mini_test.rb c:/Development/ruby-1.9.1/usr/lib/ruby/1.9.1/pathname.rb:790:in `relative_path_from': different prefix: "c:/" and "C:/Development/src/ruby_trunk/test" (ArgumentError) from C:/Development/src/ruby_trunk/test/minitest/test_mini_test.rb:33:in `' from C:/Development/src/ruby_trunk/test/minitest/test_mini_test.rb:16:in `' from c:/Development/ruby-1.9.1/usr/lib/ruby/1.9.1/test/unit.rb:55:in `require' from c:/Development/ruby-1.9.1/usr/lib/ruby/1.9.1/test/unit.rb:55:in `block in setup_argv' from c:/Development/ruby-1.9.1/usr/lib/ruby/1.9.1/test/unit.rb:49:in `each' from c:/Development/ruby-1.9.1/usr/lib/ruby/1.9.1/test/unit.rb:49:in `setup_argv' from runner.rb:9:in `
' The issues is that relative path is using case-sensitive comparisons. That's right on Linux, wrong on Windows. For whatever reason on Windows __FILE__ returns c:\.. while Dir.pwd returns C:\.. And thus the problem. I've attahced a proposed patch. If on windows (detecting mswin or mingw) then the comparison uses casecmp instead of ==. This seems like it would also apply on OS X when having a case-insensitive HFS+ drive. ---------------------------------------- http://redmine.ruby-lang.org/issues/show/1266 ---------------------------------------- http://redmine.ruby-lang.org