   
   _check_mock_usage = (args) ->
     fail(messages.MockUsage) unless 1 <= args.length <= 2
-    fail(messages.MockUsage) if args.length == 1 and not (typeof args[0] == 'function')
-    fail(messages.MockUsage) if args.length == 2 and not (typeof args[0] == 'object')
-    fail(messages.MockUsage) if args.length == 2 and not (typeof args[1] == 'function')
+    fail(messages.MockUsage) if args.length == 1 and (typeof args[0] isnt 'function')
+    fail(messages.MockUsage) if args.length == 2 and (typeof args[0] isnt 'object')
+    fail(messages.MockUsage) if args.length == 2 and (typeof args[1] isnt 'function')
     fail(messages.MockBadOptions) if args.length == 2 and not does_object_have_property(args[0], "expects_method_name") and not does_object_have_property(args[0], "mock_count")
     
   _parse_args = (args) ->

      ( @_args.every ( element, i ) -> element == args[ i ] )

  find_errors: ->
    if not @_called then format(messages.ExpectationNeverCalled, @_method_name, @_args) else ""

  # private


  throw new Error(format(message, args...))

#  
# From http://stackoverflow.com/questions/9880578/coffeescript-version-of-string-format-sprintf-etc-for-javascript-or-node-js
#
format = (message, args...) ->    # format("{0} + {1} = {2}", 2, 2, "four") => "2 + 2 = four"
  message.replace /{(\d)+}/g, (match, i) ->
