Kernel#exec should raise Errno::ENOENT if the program to execute doesn't exist
------------------------------------------------------------------------------

                 Key: JRUBY-2253
                 URL: http://jira.codehaus.org/browse/JRUBY-2253
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1RC2
         Environment: JRuby 1.1RC2
            Reporter: Vladimir Sizikov
             Fix For: JRuby 1.1
         Attachments: exec-ex.rb

Kernel#exec behavior for MRI (1.8 and 1.9) is that it raises Errno::ENOENT if 
the program to execute doesn't exist.
But for JRuby, the Errno is not being raised.

The attached tests pass with MRI, but fail with JRuby:

  1) Failure:
test_exec_empty(ExecTest) [exec-ex.rb:5]:
<Errno::ENOENT> exception expected but was
Class: <SystemExit>
Message: <"exit">
---Backtrace---
exec-ex.rb:5:in `test_exec_empty'
---------------

  2) Failure:
test_exec_non_existing(ExecTest) [exec-ex.rb:11]:
<Errno::ENOENT> exception expected but was
Class: <SystemExit>
Message: <"exit">
---Backtrace---
exec-ex.rb:11:in `test_exec_non_existing'
---------------

This also leads to one rubyspec failure:
{noformat}
1)
Kernel#exec raises a SystemCallError if cmd cannot execute FAILED
Expected SystemCallError but got SystemExit (exit):
/opt/work/rubinius/./mspec/expectations.rb:10:in `fail_with'
/opt/work/rubinius/./mspec/expectations/should.rb:6:in `should'
/opt/work/rubinius/./spec/ruby/1.8/core/kernel/exec_spec.rb:10
/opt/work/rubinius/./mspec/runner/mspec.rb:111:in `call'
/opt/work/rubinius/./mspec/runner/mspec.rb:111:in `protect'
/opt/work/rubinius/./mspec/runner/state.rb:46:in `each'
/opt/work/rubinius/./mspec/runner/state.rb:46:in `protect'
/opt/work/rubinius/./mspec/runner/state.rb:59:in `process'
/opt/work/rubinius/./mspec/runner/state.rb:55:in `each'
/opt/work/rubinius/./mspec/runner/state.rb:55:in `process'
/opt/work/rubinius/./mspec/runner/mspec.rb:19:in `describe'
/opt/work/rubinius/./mspec/runner/object.rb:11:in `describe'
/opt/work/rubinius/./spec/ruby/1.8/core/kernel/exec_spec.rb:4
/opt/work/rubinius/./mspec/runner/mspec.rb:36:in `load'
/opt/work/rubinius/./mspec/runner/mspec.rb:36:in `files'
/opt/work/rubinius/./mspec/runner/mspec.rb:111:in `call'
/opt/work/rubinius/./mspec/runner/mspec.rb:111:in `protect'
/opt/work/rubinius/./mspec/runner/mspec.rb:36:in `files'
/opt/work/rubinius/./mspec/runner/mspec.rb:33:in `each'
/opt/work/rubinius/./mspec/runner/mspec.rb:33:in `files'
/opt/work/rubinius/./mspec/runner/mspec.rb:26:in `process'
mspec/bin/mspec-ci:30
{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


Reply via email to