Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
How to run a single test method
Julian Gall
10/1/2008 9:56:00 AM
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
--
Posted via
http://www.ruby-...
.
2 Answers
danrevel
10/13/2008 5:43:00 PM
0
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.
On Oct 1, 2:55 am, Julian Gall <julian.g...@gmail.com> wrote:
> 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
> --
> Posted via
http://www.ruby-...
.
Julian Gall
10/13/2008 6:14:00 PM
0
Dear unknown,
You are a genius! Thank you very much. That is just what I was looking
for.
Julian
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
How to run a single test method
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password