[windows] File.dirname handles some edge cases differently compared to MRI
--------------------------------------------------------------------------
Key: JRUBY-4523
URL: http://jira.codehaus.org/browse/JRUBY-4523
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules, RubySpec, Windows
Affects Versions: JRuby 1.4
Reporter: Vladimir Sizikov
Fails to RubySpec tests on Windows:
{noformat}
mspec -t j core\file\dirname_spec.rb
jruby 1.5.0.dev (ruby 1.8.7 patchlevel 174) (2010-01-26 8d3d80c) (Java
HotSpot(TM) Client VM 1.6.0_18) [x86-java]
.....F..F.
1)
File.dirname returns all the components of filename except the last one (edge
cases on windows) FAILED
Expected "/"
to equal "//foo"
D:/work/jruby-dev/rubyspec.git/core/file/dirname_spec.rb:57
D:/work/jruby-dev/rubyspec.git/core/file/dirname_spec.rb:3
D:/work/jruby-dev/rubyspec.git/core/file/dirname_spec.rb:55:in `load'
D:/work/jruby-dev/mspec.git/bin/mspec-run:8
2)
File.dirname returns the return all the components of filename except the last
one (windows unc) FAILED
Expected "\\"
to equal "\\\\foo"
D:/work/jruby-dev/rubyspec.git/core/file/dirname_spec.rb:89
D:/work/jruby-dev/rubyspec.git/core/file/dirname_spec.rb:3
D:/work/jruby-dev/rubyspec.git/core/file/dirname_spec.rb:55:in `load'
D:/work/jruby-dev/mspec.git/bin/mspec-run:8
Finished in 0.090000 seconds
1 file, 10 examples, 45 expectations, 2 failures, 0 errors
{noformat}
It boils down to the following examples:
{code}
jruby -e "p File.dirname('\\\\foo\\bar.txt')"
"\\\\foo"
ruby -e "p File.dirname('\\\\foo\\bar.txt')"
"\\\\foo\\bar.txt"
{code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email