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
|
|
|
|
2011-06-04 18:19:17 -04:00
|
|
|
You can build postgres and mysql databases using the build_postgresql and build_mysql 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-04 18:19:17 -04:00
|
|
|
$ ruby 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-04 18:19:17 -04:00
|
|
|
$ ruby 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-04 18:19:17 -04:00
|
|
|
$ ARCONN=postgresql ruby 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
|
|
|
|
2010-10-10 20:15:38 -04:00
|
|
|
To setup the testing environment for PostgreSQL use this command:
|
|
|
|
|
|
|
|
rake postgresql:build_databases
|
2004-11-23 20:04:44 -05:00
|
|
|
|
2010-06-17 11:41:39 -04:00
|
|
|
The incantation for running a particular test looks like this
|
2006-07-04 22:54:19 -04:00
|
|
|
|
2011-05-26 11:24:44 -04:00
|
|
|
rake test TEST=test/cases/datatype_test_postgresql.rb TESTOPTS="--name=test_timestamp_with_zone_values_without_rails_time_zone_support"
|
2006-07-04 22:54:19 -04:00
|
|
|
|