Raise on non-defined methods

This commit is contained in:
Michael Miller 2019-11-11 22:11:58 -07:00
parent 925af7908b
commit 73e3f8fd66

View file

@ -73,6 +73,10 @@ module Spectator::Mocks
end
end
macro method_missing(call)
raise ::Spectator::Mocks::UnexpectedMessageError.new("#{self} received unexpected message {{call.name}}")
end
def to_s(io)
io << "Double("
io << @spectator_double_name