From: Austin Ziegler Date: 2005-08-04T10:03:01+09:00 Subject: Re: interesting test tool... looking for opinions. On 8/3/05, Jeff Wood wrote: > Well, first we'll need to get matz input on adding attributes @ > the function level. I don't think so. > I mean, we know that methods are objects, and therefore can have > their own values & methods (methods on methods) ... So, > we just need a good way to provide and use those attributes. > so: > class TestSuite > def testOne() :isa=test , :group="group1","group2" > # do stuff here > end > > def testTwo() :isa=test , :group="group1" , :depends_on=testOne > # do stuff here too > end > > def runTests() > methods( :isa, "test", :include, "group1", :exclude, "group2" ).run > end > end No need for attributes this way. Try this: class MyTestSuite extend Test::Unit::Testable # Hypothetical testable module test_groups :group1, :group2 test_method def test_one # ... end test_groups :group1 test_dependency :test_one test_method def test_two # ... end end Alternately: class MyTestSuite extend Test::Unit::Testable test_method :test_one, :groups => [ :group1, :group2 ] do # ... end test_method :test_two, :groups => [ :group1 ], :depends => :test_one do # ... end end This latter uses a Rake-style test declaration and uses the block as the test method. -austin -- Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca