   # private
   
   _find_signature: (method_name, args...) ->
-    for signature in @method_calls[ method_name ]
-      if ( signature.args.length == args.length ) and ( signature.args.every ( element, i ) -> element == args[ i ] )
+    for signature in @method_calls
+      if (signature.method_name == method_name) and ( signature.args.length == args.length ) and ( signature.args.every ( element, i ) -> element == args[ i ] )
         return signature
     undefined
   

class Mock

  constructor: ->
    @method_calls = {}
    @current_signature = undefined
    @state = undefined
  
  expects: (method_name) ->
    @_check_expects_usage(method_name)
    @current_signature = new Signature(method_name)
    @method_calls[ method_name ] ?= []
    @method_calls[ method_name ].push(@current_signature)
    @[ method_name ] = @_define_expected_method(method_name)
    @_set_state("expects")
    @

        
  _check_for_uncalled_signatures: ->
    messages = ""
    for signature in @method_calls when signature.called == false
      messages += "'#{signature.method_name}(#{signature.args})' was never called\n" 
    throw new Error(messages) unless messages == ""
  
  _set_state: (state) ->
