From: 7stud -- Date: 2007-10-03T00:37:12+09:00 Subject: Re: Unit testing add extra command line parameters Alin Popa wrote: > class TestSomeClass < Test::Unit::TestCase > def setup > # some setup > end > def test_01_firstTest > # some assertion > end > def test_02_secondTest > # some other assertion > end > end > > But I want to display (yes, just to display) my available tests from a > testcase. > Is this possible ? > Is this what you are after: require "test/unit" class TestSomeClass < Test::Unit::TestCase def setup # some setup end def test_01_firstTest # some assertion end def test_02_secondTest # some other assertion end end method_names = TestSomeClass.public_instance_methods test_methods = method_names.find_all do |method_name| method_name.index("test") == 0 end puts test_methods --output:-- test_01_firstTest test_02_secondTest Loaded suite r3test Started .. Finished in 0.00037 seconds. 2 tests, 0 assertions, 0 failures, 0 errors -- Posted via http://www.ruby-forum.com/.