   _check_constructor_usage = (expects_method_name) ->
     fail(messages.ExpectsMethodAlreadyExists, expects_method_name) if Object.prototype[ expects_method_name ]?
     
-  _install_expects_method = (expects_method_name) ->
+  _install_expects_method = (expects_method_name, all_expectations) ->
     Object.prototype[ expects_method_name ] = (method_name) ->
       _check_expects_usage(@, expects_method_name, method_name)
-      _create_expectation(@, method_name)
+      _create_expectation(@, method_name, all_expectations)
 
   # TODO: refactor (hideous name confusion re: expects_method, _install_uninstall_..., etc.)
   _install_uninstall_expects_method = (expects_method, expects_method_name) ->

    fail(messages.NotAnExistingMethod, method_name) if not is_mock_object(object) and not is_class(object) and not does_object_have_method(object, method_name)
    fail(messages.NotAnExistingMethod, method_name) if not is_mock_object(object) and is_class(object) and not does_prototype_have_method(object, method_name)
  
  _create_expectation = (object, method_name) ->
    new Expectation(object, method_name)

  _is_reserved_method_name = (expects_method_name, method_name) ->
    method_name == expects_method_name

    try
      _check_mock_usage(args)
      [ expects_method_name, mock_count, test_function ] = _parse_args(args)
      all_expectations = new AllExpectations()    # TODO: use factory method instead of new (same for other classes)
      expects_method = new ExpectsMethod(expects_method_name, all_expectations)
      convenience_mocks = _build_convenience_mock_objects(mock_count)
      _run_test_function(test_function, convenience_mocks)
      all_expectations.verify_all_expectations()
    finally
      expects_method.uninstall_expects_method() if expects_method?  # TODO: the 'if' guard smells?
      all_expectations.uninstall_all_mocked_methods() if all_expectations?
      all_expectations.unregister_all_expectations() if all_expectations?

  # private
  
