truffleruby icon indicating copy to clipboard operation
truffleruby copied to clipboard

mail: all in test suite fails due to ArgumentError: wrong number of arguments (given 2, expected 1) in overriding Kernel.warn

Open deepj opened this issue 5 years ago • 7 comments

The problem lies in overridden Kernel.warn in their spec/spec_helper.rb https://github.com/mikel/mail/blob/6bc16b4bce4fe280b19523c939b14a30e32

There is no issue with this on MRI. When the overridden Kernel.warn is removed, the test suite works (except several failures) on TruffleRuby as well.

To reproduce

git clone https://github.com/mikel/mail.git
cd mail
bundle
bundle exec rake

deepj avatar Feb 09 '20 19:02 deepj

Thanks for the report. The link in the description is broken, but https://github.com/mikel/mail/blob/e054847e4e186290232a308246e1287be5f1fde7/spec/spec_helper.rb#L318 works.

eregon avatar Feb 10 '20 18:02 eregon

Given that the commit adding the monkey patch is https://github.com/mikel/mail/commit/bf418912133d0aee5fdd9a5140fe5fb44cf4091f, I'd think it was never intended to override Kernel#warn.

eregon avatar Feb 10 '20 18:02 eregon

I asked on the original PR: https://github.com/mikel/mail/pull/1105

eregon avatar Feb 10 '20 18:02 eregon

A minimal reproduction for this is jt ruby -w -e 'module Kernel; def warn(m); $stderr.puts(m); end; end; p nil =~ "test" '.

bjfish avatar Feb 10 '20 18:02 bjfish

I made a PR to the mail gem: https://github.com/mikel/mail/pull/1378

eregon avatar Feb 13 '20 21:02 eregon

@deepj I believe you are welcome in the Ruby community. You are certainly welcome here on the TruffleRuby tracker. We value highly your reported issues. I would like to reopen them as they are still valid issues, would that be OK with you?

eregon avatar Jun 09 '20 09:06 eregon

@deepj You are welcome on the TruffleRuby tracker. Your bugs are highly valued and they are valid, so I will reopen them. That way we can track them again, avoid duplicate bug reports, etc. Thank you for all your issue reports so far. We hope to see you discuss here soon again.

eregon avatar Jun 19 '20 15:06 eregon

We have fixed this.

eregon avatar Mar 17 '23 17:03 eregon