Forum: Ruby how to run just one test method in a test case

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.
6c382202075fdcd2522d34633d7ecd9b?d=identicon&s=25 nicknameoptional (Guest)
on 2006-01-24 21:04
(Received via mailing list)
for example, I have a testcase class, which has test_1, test2, test3
.... methods. how to run just one of the test, like test_1? Thanks
Cee0292fffa691f1fb320d5400200e99?d=identicon&s=25 Marcel Molina Jr. (Guest)
on 2006-01-24 21:19
(Received via mailing list)
On Wed, Jan 25, 2006 at 05:03:13AM +0900, nicknameoptional wrote:
> for example, I have a testcase class, which has test_1, test2, test3
> .... methods. how to run just one of the test, like test_1? Thanks

The -n option.

You can run a test by name

e.g.

  ruby tc_foo.rb -n test_foo_1

or by pattern match

  ruby tc_foo.rb -n /foo_2/

marcel
6c382202075fdcd2522d34633d7ecd9b?d=identicon&s=25 nicknameoptional (Guest)
on 2006-01-24 21:34
(Received via mailing list)
thanks. should read my rails book more carefully.
This topic is locked and can not be replied to.