README.rdoc in armin-joellenbeck-rdbc-0.2.4 vs README.rdoc in armin-joellenbeck-rdbc-0.2.5
- old
+ new
@@ -1,6 +1,6 @@
-=Design by Contract for Ruby
+=Rdbc -- Design by Contract for Ruby
This library supports Design by Contract for Ruby.
=Installation
@@ -8,24 +8,19 @@
$ gem install armin-joellenbeck-rdbc --source http://gems.github.com
=Usage
-A a standard example for Design by Contract consider the following Stack
-class and its contract StackContract.
-
- :include:spec/stack_spec.rb
-
-The mechanics are really simple. There is the class Stack.
+Given there is a the class Foo.
For instances of this class you can define a contract by subclassing
-<b>DesignByContract::Contract</b>, in the example the contract is named
-StackContract.
-Then connect the class Stack to its contract StackContract by using the line
- contract StackContract
-in the class definition of Stack.
+<b>Rdbc::Contract</b>, in the example the contract is named
+FooContract.
+Then connect the class Foo to its contract FooContract by using the line
+ contract FooContract
+in the class definition of Foo.
-Then the following happens when a method of a Stack instance is called:
+Then the following happens when a method of a Foo instance is called:
1. the corresponding pre condition is called with the parameters:
* the instance itself
* the parameters of the method call
@@ -42,14 +37,10 @@
* the instance after the method is called
The instance before the execution of *method* in 3. and 4.
is in fact a copy of the instance before the execution. So you have to implement
the method *initialize_copy* in the class under contract, i.e. the class
-Stack.
-
-In any of these contract methods you can use assertions as in Test::Unit tests.
-When an assertion fails, the exception Test::Unit::AssertionFailedError
-is raised.
+Foo.
=Support
The project home is at
GitHub[http://github.com/armin-joellenbeck/rdbc/tree/master]: