Skip to content
Browse files

Improved documentation, and added #mock alias to TestCaseHelpers

darcs-hash:20060706075336-9ce57-421abf2b09d9bb0e5ddd70fa90328e70b1e6adf5.gz
  • Loading branch information...
1 parent d12cbe4 commit eab07a47831a897025ba3f414cb93fcebc4b3232 Steve committed Jul 6, 2006
Showing with 11 additions and 3 deletions.
  1. +6 −3 README
  2. +5 −0 lib/mockr.rb
View
9 README
@@ -3,14 +3,17 @@
Mockr is a pure Ruby library to support the Mock Objects approach to
unit testing, and is inspired by Java's JMock.
-Several other Mock Object libraries exist for Ruby. Mockr has two main
+Several other Mock Object libraries exist for Ruby. In addition to its
+unusually natural syntax for setting expectations, Mockr has two main
distinguishing features:
1. Support for the distinction between mocking and stubbing
2. A constraint-based mechanism for matching call parameters
MockR was initially presented by author Steve Purcell at the
-2005 European Ruby Conference.
+2005 European Ruby Conference, and was written entirely test-first.
+
+For more information or to contact the author, see http://mockr.sanityinc.com.
== Introduction
@@ -82,7 +85,7 @@ These tests would be satisfied by the following class:
Home page
-* http://mockr.sanityinc.com/
+* http://mockr.sanityinc.com
== Copyright
View
5 lib/mockr.rb
@@ -69,6 +69,9 @@ def verify
end
end
+ # Execute the given block and call #verify afterwards. You are unlikely
+ # to use this method, since the methods in TestCaseHelpers render it
+ # somewhat redundant.
def use &block
block.call(proxy)
verify
@@ -196,6 +199,8 @@ def new_mock
mock
end
+ alias mock new_mock
+
def teardown # :nodoc:
verify_all_mocks
end

0 comments on commit eab07a4

Please sign in to comment.
Something went wrong with that request. Please try again.