Forum: Ruby on Rails 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 19:53
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.
Frederick C. (Guest)
on 2009-04-17 21:02
(Received via mailing list)
On 17 Apr 2009, at 16:53, Fernando P. wrote:

> 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

test method names have to start with test (ie test_some_test ) which
is what the block for of test does.
ruby ... -n test_some_test should do the trick

Fred
This topic is locked and can not be replied to.