 #
 mock = (args...) ->
   
-  _test_function = undefined
-  _expects_method_name = undefined
-  _mock_count = undefined
-  _mock_objects = undefined
-  _mock_methods = undefined
+  test_function = undefined
+  expects_method_name = undefined
+  mock_count = undefined
+  mock_objects = undefined
+  mock_methods = undefined
 
   load_args = (args) ->
     check_usage(args)

    @_called = no

  args: (args...) ->
    _check_args_usage(@, args)
    @_args = args
    @

  returns: (value) ->
    _check_returns_usage(@, value, arguments.length)
    @_returns = value
    @

  throws: (error) ->
    _check_throws_usage(@, error, arguments.length)
    @_throws = error
    @


    install_expects_method()

  run_test_function = ->
    test_function.apply(null, mock_objects)

  verify_expectations = ->
    errors = mock_methods.find_errors()
    fail( errors.join("\n") + "\n" ) if errors.length > 0

  cleanup_environment = ->
    mock_methods.uninstall_mock_methods()
    uninstall_expects_method()

  check_usage = (args) ->
