From: itsme213@... Date: 2005-11-01T02:52:06+09:00 Subject: Re: TeSLa, a Domain Specific Language for Unit Testing I like this direction. obscured by code wrote: > test_method :add_item => [:item4] do > requires {@items = [:item1, :item2, :item3]} > assert {size == 4} > end > > is indeed declared just bellow the 'add_item' method in class Catalog > and that 'items' is a property of that class. 'test_method' will create > a clean instance of class Catalog and execute the 'add_item' method > with :item4 as a parameter and 'assert' will check that 'size' (of the > Catalog instance) is indeed 4 as long of the 'precondition' stated by > requires was met. So what part of the code makes {@items = [:...]} true? You might also find it useful to look at ruby-contract: http://ruby-contract.rubyforge.org/wiki/wiki.pl?HomePage