[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How to run a single test with Test::Unit?

Fernando Perez

4/17/2009 4:46:00 PM

Hi,

I have tests written as:

test "some test" do
...
end


But when I want to run a single test it doesn't work like before:

$ ruby test/functional/some_controller_test.rb -n some_test

Iget 0 test, 0 assertions...

I also rewrote the test to :

def some_test
...
end


And still no luck. Has anything changed from the various tutorials found
on the internet? Also guides.rubyonrails.org has nothing about that.
--
Posted via http://www.ruby-....

3 Answers

Jeremy Kemper

4/17/2009 4:51:00 PM

0

On Fri, Apr 17, 2009 at 11:45 AM, Fernando Perez <pedrolito@lavache.com> wr=
ote:
> Hi,
>
> I have tests written as:
>
> test "some test" do
> =A0...
> end
>
>
> But when I want to run a single test it doesn't work like before:
>
> $ ruby test/functional/some_controller_test.rb -n some_test
>
> Iget 0 test, 0 assertions...
>
> I also rewrote the test to :
>
> def some_test
> =A0...
> end
>
>
> And still no luck. Has anything changed from the various tutorials found
> on the internet? Also guides.rubyonrails.org has nothing about that.


test "some test" do ...

becomes

def test_some_test ...

so use -n test_some_test

jeremy

Fernando Perez

4/17/2009 4:56:00 PM

0

> test "some test" do ...
>
> becomes
>
> def test_some_test ...
>
> so use -n test_some_test
>
> jeremy

Unfortunately it doesn't work :(
--
Posted via http://www.ruby-....

Fernando Perez

4/17/2009 5:00:00 PM

0

>> so use -n test_some_test
>>
>> jeremy
>
> Unfortunately it doesn't work :(

Damn! I didn't spot the test_ my eyes are getting tired! Enough work for
today.

Thanks and have a nice weekend.
--
Posted via http://www.ruby-....