[1.9] Wrong parameters parse for method signatures with default values
----------------------------------------------------------------------
Key: JRUBY-5303
URL: http://jira.codehaus.org/browse/JRUBY-5303
Project: JRuby
Issue Type: Bug
Components: Parser, Ruby 1.9
Reporter: David Calavera
Assignee: Thomas E Enebo
The new method signature causes MiniTest doesn't handle default arguments
properly. I've reduced the issue to this code:
{code}
require 'minitest/unit'
module Foo
include MiniTest::Assertions
def assert(test, msg = (nomsg = true; nil))
super
end
end
include Foo
assert 'foo' == '', 'expected blank'
{code}
The expected output is:
{code}
`assert': expected blank (MiniTest::Assertion)
{code}
but I get the MiniTest default message:
{code}
`assert': Failed assertion, no message given. (MiniTest::Assertion)
{code}
The signature of the assert above is the same that TestUnit has for Ruby 1.9
and that causes ActiveSupport tests fail:
https://github.com/jruby/jruby/blob/master/lib/ruby/1.9/test/unit/assertions.rb#L13
If I remove the "nomsg = true" parameter it works fine.
--
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