2011-06-04 22:19:17 +00:00
|
|
|
== Configure databases
|
2004-11-24 01:04:44 +00:00
|
|
|
|
2011-06-04 22:19:17 +00: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-24 01:04:44 +00:00
|
|
|
|
2011-06-04 22:19:17 +00:00
|
|
|
You can build postgres and mysql databases using the build_postgresql and build_mysql rake tasks.
|
2004-11-24 01:04:44 +00:00
|
|
|
|
2011-06-04 22:19:17 +00:00
|
|
|
== Running the tests
|
2004-11-24 01:04:44 +00:00
|
|
|
|
2011-06-04 22:19:17 +00:00
|
|
|
You can run a particular test file from the command line, e.g.
|
2004-11-24 01:04:44 +00:00
|
|
|
|
2011-06-04 22:19:17 +00:00
|
|
|
$ ruby test/cases/base_test.rb
|
2004-11-24 01:04:44 +00:00
|
|
|
|
2011-06-04 22:19:17 +00:00
|
|
|
To run a specific test:
|
2004-11-24 01:04:44 +00:00
|
|
|
|
2011-06-04 22:19:17 +00:00
|
|
|
$ ruby test/cases/base_test.rb -n test_something_works
|
2004-11-24 01:04:44 +00:00
|
|
|
|
2011-06-04 22:19:17 +00: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 05:13:00 +00:00
|
|
|
|
2011-06-04 22:19:17 +00:00
|
|
|
$ ARCONN=postgresql ruby test/cases/base_test.rb
|
2008-05-03 16:29:47 +00:00
|
|
|
|
2011-06-04 22:19:17 +00:00
|
|
|
You can run all the tests for a given database via rake:
|
2006-07-05 02:54:19 +00:00
|
|
|
|
2010-10-11 00:15:38 +00:00
|
|
|
To setup the testing environment for PostgreSQL use this command:
|
|
|
|
|
|
|
|
rake postgresql:build_databases
|
2004-11-24 01:04:44 +00:00
|
|
|
|
2010-06-17 15:41:39 +00:00
|
|
|
The incantation for running a particular test looks like this
|
2006-07-05 02:54:19 +00:00
|
|
|
|
2011-05-26 15:24:44 +00:00
|
|
|
rake test TEST=test/cases/datatype_test_postgresql.rb TESTOPTS="--name=test_timestamp_with_zone_values_without_rails_time_zone_support"
|
2006-07-05 02:54:19 +00:00
|
|
|
|