design_by_contract_example.rb

Path: examples/design_by_contract_example.rb
Last Update: Tue Apr 15 20:32:32 -0500 2008

Example demonstrating "Design by Contract", Bertrand Meyer‘s idea for programmatically- specifying the contract of use for a class or module and testing it at runtime (usually during the testing process) This example is adapted from spec/extras/design_by_contract_spec.rb. Note: the DesignByContract module adds the precondition, postcondition, and invariant methods shown below to Object and they use "self" as the :object to advise.

Required files

aquarium/extras/design_by_contract  

[Validate]