igrep / crispy

Test Spy for Any Object in Ruby.
http://rubygems.org/gems/crispy
MIT License
22 stars 2 forks source link

Spy class methods correctly #19

Closed igrep closed 9 years ago

igrep commented 9 years ago

I forgot to reset received_message when spy_into an already-spied object. So seems crispy can't log class methods correctly.

e.g.

class Hoge
  def self.foo
  end
end

Crispy.spy_into Hoge
Hoge.foo

Crispy.spy_into Hoge
Hoge.foo

spy(Hoge).received_messages
#=> the doubled received messages!