Is this a unit/test bug?

C:\dev\ruby\ties>ruby
C:\dev\ruby\ties\test\functional\store_controller_test.rb
-ntest_gives_single_discount

this one works ^^^^^^

this one fails vvvvvv

C:\dev\ruby\ties>ruby
C:\dev\ruby\ties\test\functional\store_controller_test.rb
–testcase=test_gives_single_discount
C:/dev/ruby/ties/test/functional/…/test_helper
Loaded suite C:/dev/ruby/ties/test/functional/store_controller_test
Started

Finished in 0.0 seconds.

0 tests, 0 assertions, 0 failures, 0 errors

but --testcase is supposed to be a test pattern…anybody know what’s
going on here? I’m thinking this is a bug.
-r

On 8/8/09, Roger P. [email protected] wrote:

–testcase=test_gives_single_discount
C:/dev/ruby/ties/test/functional/…/test_helper
Loaded suite C:/dev/ruby/ties/test/functional/store_controller_test
Started

Finished in 0.0 seconds.

0 tests, 0 assertions, 0 failures, 0 errors

but --testcase is supposed to be a test pattern…anybody know what’s
going on here? I’m thinking this is a bug.

As far as I know, the -n (or --name) parameter to test/unit gives the
name of a test method (or methods) to be run. The -t (or --testcase)
parameter gives the name of a test class. So, it looks like the second
command didn’t do what you want because there’s no class named
test_gives_single_discount.

PS: if you want to use a pattern (regex) in names used by -n and -t, I
think you have to enclose the name in slashes. (eg: -n
/test_gives_single_discount/ )

On Aug 8, 2009, at 12:24 , Roger P. wrote:

I cleaned it up for you:

but --testcase is supposed to be a test pattern…anybody know what’s
going on here? I’m thinking this is a bug.

no, --testcase MAY take a pattern, and you didn’t provide one
(patterns start with “/” like default regexps). But that isn’t your
problem. This should shed some light:

502 % ruby -rtest/unit -e 0 – --help
Test::Unit automatic runner.
Usage: -e [options] [-- untouched arguments]


-n, --name=NAME Runs tests matching NAME.
(patterns may be used).
-t, --testcase=TESTCASE Runs tests in TestCases matching
TESTCASE.
(patterns may be used).

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs