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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fernando P. (Guest)
on 2009-04-17 20:45
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.
Jeremy K. (Guest)
on 2009-04-17 20:51
(Received via mailing list)
On Fri, Apr 17, 2009 at 11:45 AM, Fernando P. 
<removed_email_address@domain.invalid>
wrote:
>
>
> 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 P. (Guest)
on 2009-04-17 20:56
> test "some test" do ...
>
> becomes
>
> def test_some_test ...
>
> so use -n test_some_test
>
> jeremy

Unfortunately it doesn't work :(
Fernando P. (Guest)
on 2009-04-17 20:59
>> 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.
This topic is locked and can not be replied to.