On Fri, 2006-03-24 at 05:28 +0900, rtilley wrote:
I can’t get test/unit to work with command line scripts that take user
input via ARGV. Any tips on this? I continually get ‘initialize’: wrong
number of arguments (0 for 1) (ArgumentError) that go back to my
initialize method which is simply this:
(I assume this is in a testcase class?)
Test::Unit::TestCase#initialize requires one argument, the name of the
test being run. For each test method, a new instance is used. You would
need to do:
You could omit (name) from the super call (it assumes the same arguments
anyway) but I prefer to be explicit.
All that said, you should generally handle custom initialization for
your tests from the ‘setup’ method, which is called before each test is
As a general tip, whenever you have a situation like this you can
To see what you’re supposed to be dealing with.