SystemExit#status method not implemented
----------------------------------------
Key: JRUBY-1098
URL: http://jira.codehaus.org/browse/JRUBY-1098
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.0.0RC3
Environment: OS X 10.4.9, Java 1.5, JRuby 2007-06-03 rev 3812
Reporter: Daniel Berger
Priority: Minor
The SystemExit exception class (and no other) implements the 'status' method,
which is usually just the status set by an exit() call. JRuby doesn't appear to
implement it. Here's the test case I'm using in my own test suite:
{noformat}
class TC_Exception_Status_InstanceMethod < Test::Unit::TestCase
def setup
@err = nil
begin; exit(99); rescue SystemExit => @err; end
end
def test_status_basic
assert_respond_to(@err, :status)
assert_nothing_raised{ @err.status }
assert_kind_of(Fixnum, @err.status)
end
def test_status
assert_equal(99, @err.status)
begin; exit(-1); rescue SystemExit => @err; end
assert_equal(-1, @err.status)
end
# Only the SystemExit class implements this method
def test_status_expected_errors
assert_raise(ArgumentError){ @err.status(99) }
begin; 1/0; rescue Exception => @err; end
assert_raise(NoMethodError){ @err.status }
end
def teardown
@err = nil
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