EvanDonahue / Contracts
About Contracts
Contracts allow you to write type signatures for your methods and have them dynamically checked during testing.
Examples:
MyIntegerr >> + aNumber
MyInteger >> squared
MyCollection >> collect: aBlockOrSymbol
MyCollection >> add: anObject
To activate the contracts on a given class, use MyClass >> enforceContractC. To remove all contracts, use MyClass >> unenforceContractC.
NB: Be sure to unenforceContractC before attempting to edit a class method. Contracts do not play well with Nautilus or Monticello. Recommendation is to use #enforceContractC in TestCase >> setUp and #unenforceContractC in TestCase >> tearDown.
