[Rake-devel] Test organization

Jim Weirich jim at weirichhouse.org
Mon May 2 16:29:30 EDT 2005

Berger, Daniel said:
> Hi all,
> I have a few suggestions for the test suite:
> 1) Please move each test case into its own file.  Having multiple test
> cases in the same file is confusing the heck out of me.

TestTask seems to be the major offender here.  The others mostly 1-to-1.

> 2) Add this bit of code to the top of each test file:

The LOAD_PATH munging is handled by the rake task.  I always run the tests
via rake so never have to worry about this.  Also rake deals with the "run
from any directory issue" as well.

If you want to run just one test file, e.g. ruby test\testtasks.rb, do this:

  rake test TEST=test/testtasks.rb

(Unix style command line quoting assumed, change appropriately for windows).

> 3) Give me a test_all.rb that allows me to run all tests at once.  Or is
> there something like that already?  I didn't see it.

Handled by the Rakefile (see answer to #2).

> 4) Nitpick: can we please put underscores in the test file names?  e.g.
> test_tasks.rb instead of testtasks.rb.  It's just easier on my eyes. :)

Reasonable request.  I think I changed my style over time to use
underscores where before I didn't.

Thanks for the patches, suggestions and help.

-- Jim Weirich     jim at weirichhouse.org    http://onestepback.org
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)

More information about the Rake-devel mailing list