From: Ken Coar Date: 2010-02-14T05:11:55+09:00 Subject: Re: Delegating testing to another class Found a solution: Ken Coar wrote: > > class TestMyStuff < Test::Unit::TestCase > def test1() > TestVals.each do |t1| # TestVals is an array of TestIt objects t1.tCase = self > t1.test do |t2| > true > end > end > end > end > > class TestIt > def test(&block) @tCase.assert("Descriptive message") do > block.call > end > end > end Not exactly elegant, but by passing the caller I can access its assert* methods explicitly rather than implicitly. -- Posted via http://www.ruby-forum.com/.