Skip to content

Prepended modules cause spy to think a method has never been hooked #7

@sgrif

Description

@sgrif

Steps to reproduce:

class Foo
  class << self
    prepend Bar
  end

  def self.foo
  end
end

module Bar
  def foo
  end
end

class Test < MiniTest::Test
  def test_stuff
    Spy.on(Foo, :bar)
  end
end

Spy will continuously complain that Foo.bar hasn't been hooked, and will continue to do so for every subsequent test run as it continuously tries to unhook the method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions