Well, it's not as simple as that. The spec as written is for *nix paths, where
///// is root. So on one side we should move towards ///// returning the
current drive. On the other hand, the notation // represents a UNC file path,
which theoretically should resolve to a form of //server/share. I don't know
what CRuby wants dirname to return, and I also don't know if we are going to
deviate at all. I know that it currently returns //, but if you search for this
function, there is some discussion about how it should behave, and I'm not sure
how it resolved. For now, I'd suggest turning it into:
platform_is_not :windows do
File.dirname('/////').should == '/'
end
platform_is :windows do
File.dirname('/////').should == '//'
end
That will keep it working on *nix.
JD
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Unnikrishnan Nair
Sent: Sunday, July 06, 2008 8:51 PM
To: [email protected]
Subject: [Ironruby-core] spec changes
I think the following spec is wrong for FileOps.dirname
It is
File.dirname('/////').should == '/'
but it should be
File.dirname('/////').should == '//'
If it is my misunderstanding, please let me know.
Thanks,
Unni
_______________________________________________
Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core