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