 #
 # mock()
 #
-# mock (mocked_book) ->
-#   mocked_book.expects("read")
-#   ...
-#
 class Mock
   
+  #
+  # mock (my_mock) ->
+  #   my_mock.expects("my_method")
+  #   ...
+  #
   publish.mock = (test_function) ->
     try
-      _install_expects_method()
+      Expects.install_expects_method()
       convenience_mocks = _build_convenience_mock_objects()
       _run_test_function(test_function, convenience_mocks)
       AllExpectations.verify_all_expectations()
     finally
-      _uninstall_expects_method()
+      Expects.uninstall_expects_method()
       AllExpectations.uninstall_all_mocked_methods()
       AllExpectations.unregister_all_expectations()
 
   # private
-  
-  _install_expects_method = ->
-    Object.prototype.expects = Expects.expects
-
-  _uninstall_expects_method = ->
-    delete Object.prototype.expects
 
   _build_convenience_mock_objects = ->
     ( new Object() for i in [1..5] )

#
class Expects
  
  @expects: (method_name) ->
    _check_expects_usage(@, method_name)
    _create_expectation(@, method_name)


#
# common
#
is_class = (object) ->
   typeof object == 'function'
 
