6 # Creates a new mock with a +name+ (that will be used in error messages only)
8 # * <tt>:null_object</tt> - if true, the mock object acts as a forgiving null object allowing any message to be sent to it.
9 def initialize(name, options={})
14 def method_missing(sym, *args, &block)
15 __mock_proxy.instance_eval {@messages_received << [sym, args, block]}
17 return self if __mock_proxy.null_object?
18 super(sym, *args, &block)
20 __mock_proxy.raise_unexpected_message_error sym, *args
25 "#<#{self.class}:#{sprintf '0x%x', self.object_id} @name=#{@name.inspect}>"