Chris@909: == Creating the test database Chris@909: Chris@909: The default name for the test databases is "activerecord_versioned". If you Chris@909: want to use another database name then be sure to update the connection Chris@909: adapter setups you want to test with in test/connections//connection.rb. Chris@909: When you have the database online, you can import the fixture tables with Chris@909: the test/fixtures/db_definitions/*.sql files. Chris@909: Chris@909: Make sure that you create database objects with the same user that you specified in i Chris@909: connection.rb otherwise (on Postgres, at least) tests for default values will fail. Chris@909: Chris@909: == Running with Rake Chris@909: Chris@909: The easiest way to run the unit tests is through Rake. The default task runs Chris@909: the entire test suite for all the adapters. You can also run the suite on just Chris@909: one adapter by using the tasks test_mysql_ruby, test_ruby_mysql, test_sqlite, Chris@909: or test_postresql. For more information, checkout the full array of rake tasks with "rake -T" Chris@909: Chris@909: Rake can be found at http://rake.rubyforge.org Chris@909: Chris@909: == Running by hand Chris@909: Chris@909: Unit tests are located in test directory. If you only want to run a single test suite, Chris@909: or don't want to bother with Rake, you can do so with something like: Chris@909: Chris@909: cd test; ruby -I "connections/native_mysql" base_test.rb Chris@909: Chris@909: That'll run the base suite using the MySQL-Ruby adapter. Change the adapter Chris@909: and test suite name as needed. Chris@909: Chris@909: == Faster tests Chris@909: Chris@909: If you are using a database that supports transactions, you can set the Chris@909: "AR_TX_FIXTURES" environment variable to "yes" to use transactional fixtures. Chris@909: This gives a very large speed boost. With rake: Chris@909: Chris@909: rake AR_TX_FIXTURES=yes Chris@909: Chris@909: Or, by hand: Chris@909: Chris@909: AR_TX_FIXTURES=yes ruby -I connections/native_sqlite3 base_test.rb