 _throw_args_must_be_after_expects = ->
   throw ".args() must be called immediately after .expects(), e.g. my_mock.expects('my_method').args(42)"
 
-_throw_duplicate_expectation = (signature) ->
-  throw "#{signature} is a duplicate expectation"
+_throw_duplicate_expectation = (expectation) ->
+  throw "#{expectation} is a duplicate expectation"
 
 _throw_returns_usage = ->
   throw "you need to supply an argument to .returns(), e.g. my_mock.expects('my_method').returns(123)"

    @called = false

  #
  # Returns true if this signature equals (has the same values
  # as) another.  For example:
  #
  #   ms1 = new MethodSignature("my_method")
  #   ms1.args = [ 1, "a" ]
  #
  #   ms2 = new MethodSignature("my_method")
  #   ms2.args = [ 1, "a" ]
  #
  #   ms1.equals(ms2)       # returns true
  #
  # Note: this method is similar to matches() but is used to
  # find duplicate MethodSignatures.
  #
  equals: (other) ->
    @matches(other.method_name, other.args...)

  #
  # Returns true if this signature has the specified method
  # name and arguments.  For example:
  #
  #   ms = new MethodSignature("my_method")
  #   ms.args = [ 1, "a" ]
  #   ...
  #   ms.matches( "my_method", [ 1, "a" ] )     # returns true
  #   ms.matches( "your_method", [ 1, "a" ] )   # returns false
  #   ms.matches( "my_method", [ 2, "b" ] )     # returns false
  #
  # Note: this method is similar to equals() but is used to 
  # search for a MethodSignature with a given name and args.
  #
  matches: (method_name, args...) ->
    ( @method_name == method_name ) and

# Private Mock 'methods'; making them functions keeps the Mock object uncluttered.
#

_expectations = (mock) ->
  mock.expectations ?= []

_set_state = (mock, state) ->
  mock.state = state
