Run all tests

Hello all,

In learning ruby I’ve created a ton of rb files.

Organizationally my files are a mess. Some of my files contain only
tests,
some have tests and code, and some have code with tests wrapped with an
if
FILE == $0 … end guard . Some files require other rb files and
the
files are scattered over a handful of directories.

Is there a good way to run all my tests at once?

–Brian

On 6/14/06, Brian B. [email protected] wrote:

Hello all,

In learning ruby I’ve created a ton of rb files.

Organizationally my files are a mess. Some of my files contain only tests,
some have tests and code, and some have code with tests wrapped with an if
FILE == $0 … end guard . Some files require other rb files and the
files are scattered over a handful of directories.

Is there a good way to run all my tests at once?

I recommend changing all your test code to use Test::Unit.

If you

  1. name all those source files following the convention test_*.rb
  2. put the code being tested in a directory named lib
  3. put the test code in a sibling directory named test

then you can run all your tests from the lib directory with
testrb …/test