File.expand_path does not correctly follow directory changes from Dir.chdir
---------------------------------------------------------------------------
Key: JRUBY-3424
URL: http://jira.codehaus.org/browse/JRUBY-3424
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Reporter: Logan Barnett
Fix For: JRuby 1.2
Two tests included. One that shows that Dir.pwd isn't the culprit (pass). The
other shows File.expand_path (fails).
{noformat}
describe "File.expand_path" do
before do
Dir.mkdir(File.expand_path(File.dirname(__FILE__)) + '/foo')
end
after do
Dir.rmdir(File.expand_path(File.dirname(__FILE__)) + '/foo')
end
it "works inside a moving PWD (due to Dir.chdir)" do
Dir.chdir(File.expand_path(File.dirname(__FILE__)) + '/foo') do
#uncomment to see how the path looks
#puts Dir.pwd
#puts File.expand_path(File.dirname(__FILE__))
(File.expand_path(File.dirname(__FILE__)) + '/foo').should == Dir.pwd
end
end
# to show that Dir.pwd isn't the culprit
it "Dir.pwd works inside a moving PWD (due to Dir.chdir)" do
original_pwd = ''
Dir.chdir(File.expand_path(File.dirname(__FILE__))) do
original_pwd = Dir.pwd
end
Dir.chdir(File.expand_path(File.dirname(__FILE__)) + '/foo') do
#uncomment to see how the path looks
#puts Dir.pwd
#puts File.expand_path(File.dirname(__FILE__))
(original_pwd + '/foo').should == Dir.pwd
end
end
end
{noformat}
--
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