RUNNING_UNIT_TESTS

Path: RUNNING_UNIT_TESTS
Last Update: Sun Feb 22 15:54:36 CET 2004

Creating the test database

The default name for the test database is "activerecord_unittest". If you want to use another database name then be sure to update the connection adapter setups you want to test with in connections/. When you have the database online, you can import the fixture tables with the fixtures/fixture_database.sql file.

Running with Rake

The easiest way to run the unit tests is through Rake. The default task runs the entire test suite for all the adapters. You can also run the suite on just one adapter by using the tasks test_dbi_mysql, test_mysql_ruby, or test_ruby_mysql. For more information, checkout the full array of rake tasks with "rake -T"

Rake can be found at rake.rubyforge.org

Running by hand

If you only want to run a single test suite, or don’t want to bother with Rake, you can do so with something like:

   ruby -I "connections/dbi_mysql" base_test.rb

That‘ll run the base suite using the dbi_mysql adapter. Change the adapter and test suite name as needed.

[Validate]