I’m trying to get the Sidekiq specs running green under JRuby 1.7.8 and
I’m
seeing a somewhat obscure error in a MiniTest (4.7.5) mock. I’m getting
the following:
- Error:
manager#test_0002_assigns work to a processor:
NoMethodError: unmocked method :==, expected one of []
org/jruby/RubyArray.java:1957:in==' org/jruby/RubyHash.java:1069:in
==’
org/jruby/RubyArray.java:1303:ininclude?' org/jruby/RubyArray.java:1613:in
each’
org/jruby/RubyHash.java:1338:in `each’
/Users/peter/Development/apps/petergoldstein/sidekiq/test/test_manager.rb:24:in
test_0002_assigns work to a processor' org/jruby/RubyArray.java:2413:in
map’
org/jruby/RubyArray.java:2413:in map' org/jruby/RubyArray.java:1613:in
each’
The spec runs cleanly under MRI.
I’m trying to understand the issue, and whether this is something that
needs to be resolved on the JRuby side or on the MiniTest side.
From what I can tell it looks like the issue is how equality is being
invoked on the member objects in the JRuby implementation of ‘==’ on
RubyArray. It seems to be using the ‘==’ method, which is not
explicitly
mocked, and in fact causes an error when directly invoked.
Does ‘==’ need to be included in ‘overridden_methods’ as defined here:
Is there another change on the MiniTest side that is required? Or is
this
something that needs to be resolved on the JRuby side?
Any insight would be appreciated. Thanks.
Best,
Peter