Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
prepending to the singleton class of a module breaks instance_method #4477
jruby 220.127.116.11 (2.3.1) 2017-01-11 68056ae Java HotSpot(TM) 64-Bit Server VM 25.121-b13 on 1.8.0_121-b13 +jit [linux-x86_64]
Ubuntu 16.04 LTS, jruby installed from rbenv with no special flags.
I'm the maintainer of flexmock, and during some of the partial mock operations, flexmock prepends to the singleton class of the object that is being mocked. It also stores the original instance method before mocking it so as to be able to call it as part of the mock process. On both MRI and JRuby, this works fine for plain objects. However, when the object is itself a module, it works on MRI but fails on JRuby
The problem can be reproduced with:
MRI executes it without any problem, while JRuby fails with