gimme
gimme copied to clipboard
Unable to verify spies of module functions
Creating a spy on a module_function works as expected and the invocations are tracked correctly:
module TestModule
module_function
def test_method; end
end
spy_on(TestModule, :test_method)
TestModule.test_method #=> 1
TestModule.test_method #=> 2
However, verifying invocations raises an exception:
NoMethodError: undefined method `cls' for TestModule:Module
I noticed this in the past as well. Smells like something is doing a kind_of?(Class) and messing up the class reference.