From: ara.t.howard@... Date: 2007-02-16T05:12:03+09:00 Subject: Re: Best way to skip tests On Fri, 16 Feb 2007, Tim Pease wrote: >> >> class MyTest < Test::Unit::TestCase >> def test_foo >> ... >> end >> >> def test_bar >> ... >> end >> >> if Time.now.wday == 0 >> skip :test_foo, "The frambulator isn't available on Sundays" >> end >> end >> > > Now you have test names in two places, and when someone renames > :test_foo to :test_frambulator ?? Whoops! > > I like the idea of having a skip assertion inside the test, and it has > to be first assertion used otherwise an exception is raised. > > TwP why not block form class MyTest < Test::Unit::TestCase def test_bar assert this skip :sometimes, Time.now.wday == 0 do assert sometimes end assert that end end obvious it would be augmented with loggig like skipping section(sometimes) of test_bar... function name scraped with caller[0]... -a -- we can deny everything, except that we have the possibility of being better. simply reflect on that. - the dalai lama