How to run a single test method

J

Julian Gall

Is there a way of running a single test in the Ruby testrunner
environment? I currently run all of the tests in my test class and suite
with:

Test::Unit::UI::Console::TestRunner.run(TC_my_test)

or:

Test::Unit::UI::Console::TestRunner.run(TC_my_suite)

I would like to be able to run a single test method from TC_my_test. I
notice that JUnit has runSingleMethod but can't find an equivalent for
Ruby.

N.B. This has to be run from the Google Sketchup Ruby command line as I
am writing code in this environment. i.e. I have access to what is
effectively an irb interface but not the ruby command (where I could add
--name test_my_test for the test name).

Thanks for any help.

Julian
 
D

danrevel

I am using:

Test::Unit::UI::Console::TestRunner.run(TC_my_test.new('test_me'))

where test_me is the name of the single test you wish to execute.
 
J

Julian Gall

Dear unknown,

You are a genius! Thank you very much. That is just what I was looking
for.

Julian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top