File.stat should follow the symbolic link and report the stat for the file 
pointed by the link
----------------------------------------------------------------------------------------------

                 Key: JRUBY-2394
                 URL: http://jira.codehaus.org/browse/JRUBY-2394
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1
         Environment: Latest JRuby
            Reporter: Vladimir Sizikov
            Assignee: Vladimir Sizikov
             Fix For: JRuby 1.1.1


Let's 'link' is a symlink to 'file', then:

{noformat}
s = File.stat('link')
p s.file?
p s.symlink?
{noformat}

On MRI prints:
true
false

On JRuby:
true
true

This leads to a new rubyspec failure:
{noformat}
mspec/bin/mspec ci -t j -X /opt/work/jruby.git/test/spec_excludes 
spec/ruby/1.8/core/file/stat_spec.rb
...F

1)
File.stat returns a File::Stat object with file properties for a symlink FAILED
Expected true
 to equal false

/opt/work/rbx.git/./mspec/expectations.rb:10:in `fail_with'
/opt/work/rbx.git/./mspec/matchers/base.rb:8:in `=='
/opt/work/rbx.git/./spec/ruby/1.8/core/file/stat_spec.rb:26:in 
`/opt/work/rbx.git/./spec/ruby/1.8/core/file/stat_spec.rb'
/opt/work/rbx.git/./mspec/runner/mspec.rb:119:in `call'
/opt/work/rbx.git/./mspec/runner/mspec.rb:119:in `protect'
/opt/work/rbx.git/./mspec/runner/state.rb:46:in `each'
/opt/work/rbx.git/./mspec/runner/state.rb:46:in `protect'
/opt/work/rbx.git/./mspec/runner/state.rb:60:in `process'
/opt/work/rbx.git/./mspec/runner/state.rb:56:in `each'
/opt/work/rbx.git/./mspec/runner/state.rb:56:in `process'
/opt/work/rbx.git/./mspec/runner/mspec.rb:26:in `describe'
/opt/work/rbx.git/./mspec/runner/object.rb:11:in `describe'
/opt/work/rbx.git/./spec/ruby/1.8/core/file/stat_spec.rb:8:in 
`/opt/work/rbx.git/./spec/ruby/1.8/core/file/stat_spec.rb'
/opt/work/rbx.git/./spec/ruby/1.8/core/file/stat_spec.rb:44:in `load'
/opt/work/rbx.git/./mspec/runner/mspec.rb:44:in `files'
/opt/work/rbx.git/./mspec/runner/mspec.rb:119:in `call'
/opt/work/rbx.git/./mspec/runner/mspec.rb:119:in `protect'
/opt/work/rbx.git/./mspec/runner/mspec.rb:44:in `files'
/opt/work/rbx.git/./mspec/runner/mspec.rb:41:in `each'
/opt/work/rbx.git/./mspec/runner/mspec.rb:41:in `files'
/opt/work/rbx.git/./mspec/runner/mspec.rb:33:in `process'
mspec/bin/mspec-ci:66:in `run'
/opt/work/rbx.git/./mspec/bin/script.rb:77:in `main'
mspec/bin/mspec-ci:73

Finished in 0.187000 seconds

1 file, 4 examples, 19 expectations, 1 failure, 0 errors
{noformat}

Will fix.

-- 
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


Reply via email to