Check expectations for anonymous double

This commit is contained in:
Michael Miller 2019-11-17 10:14:03 -07:00
parent 45fe6217b4
commit 5da231a5e8

View file

@ -15,6 +15,7 @@ module Spectator::Mocks
stub.call!(args, typeof(@values.fetch({{call.name.symbolize}}) { raise }))
else
@values.fetch({{call.name.symbolize}}) do
return nil if ::Spectator::Harness.current.mocks.expected?(self, {{call.name.symbolize}})
raise ::Spectator::Mocks::UnexpectedMessageError.new("#{self} received unexpected message {{call.name}}")
end
end