gimme icon indicating copy to clipboard operation
gimme copied to clipboard

Unable to verify spies of module functions

Open jasonkarns opened this issue 12 years ago • 1 comments

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

jasonkarns avatar Mar 02 '13 15:03 jasonkarns

I noticed this in the past as well. Smells like something is doing a kind_of?(Class) and messing up the class reference.

searls avatar Mar 02 '13 16:03 searls