2011-06-04 18:19:17 -04:00
|
|
|
== Configure databases
|
2004-11-23 20:04:44 -05:00
|
|
|
|
2011-06-04 18:19:17 -04:00
|
|
|
Copy test/config.example.yml to test/config.yml and edit as needed. Or just run the tests for
|
|
|
|
the first time, which will do the copy automatically and use the default (sqlite3).
|
2004-11-23 20:04:44 -05:00
|
|
|
|
2012-02-23 09:49:48 -05:00
|
|
|
You can build postgres and mysql databases using the postgresql:build_databases and mysql:build_databases rake tasks.
|
2004-11-23 20:04:44 -05:00
|
|
|
|
2011-06-04 18:19:17 -04:00
|
|
|
== Running the tests
|
2004-11-23 20:04:44 -05:00
|
|
|
|
2011-06-04 18:19:17 -04:00
|
|
|
You can run a particular test file from the command line, e.g.
|
2004-11-23 20:04:44 -05:00
|
|
|
|
2011-06-09 04:11:26 -04:00
|
|
|
$ ruby -Itest test/cases/base_test.rb
|
2004-11-23 20:04:44 -05:00
|
|
|
|
2011-06-04 18:19:17 -04:00
|
|
|
To run a specific test:
|
2004-11-23 20:04:44 -05:00
|
|
|
|
2011-06-09 04:11:26 -04:00
|
|
|
$ ruby -Itest test/cases/base_test.rb -n test_something_works
|
2004-11-23 20:04:44 -05:00
|
|
|
|
2011-06-04 18:19:17 -04:00
|
|
|
You can run with a database other than the default you set in test/config.yml, using the ARCONN
|
|
|
|
environment variable:
|
2010-08-14 01:13:00 -04:00
|
|
|
|
2011-06-09 04:11:26 -04:00
|
|
|
$ ARCONN=postgresql ruby -Itest test/cases/base_test.rb
|
2008-05-03 12:29:47 -04:00
|
|
|
|
2011-06-04 18:19:17 -04:00
|
|
|
You can run all the tests for a given database via rake:
|
2006-07-04 22:54:19 -04:00
|
|
|
|
2011-06-09 04:11:26 -04:00
|
|
|
$ rake test_mysql
|
2006-07-04 22:54:19 -04:00
|
|
|
|
2011-06-09 04:11:26 -04:00
|
|
|
The 'rake test' task will run all the tests for mysql, mysql2, sqlite3 and postgresql.
|
2011-06-09 15:15:34 -04:00
|
|
|
|
|
|
|
== Identity Map
|
|
|
|
|
|
|
|
By default the tests run with the Identity Map turned off. But all tests should pass whether or
|
|
|
|
not the identity map is on or off. You can turn it on using the IM env variable:
|
|
|
|
|
|
|
|
$ IM=true ruby -Itest test/case/base_test.rb
|
2011-06-12 14:08:16 -04:00
|
|
|
|
|
|
|
== Config file
|
|
|
|
|
|
|
|
By default, the config file is expected to be at the path test/config.yml. You can specify a
|
|
|
|
custom location with the ARCONFIG environment variable.
|