1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/RUNNING_UNIT_TESTS
Xavier Noria 5e21247131 Merge branch 'master' of git://github.com/lifo/docrails
Conflicts:
	activerecord/RUNNING_UNIT_TESTS
2011-06-06 22:23:30 +02:00

32 lines
1 KiB
Text

== Configure databases
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).
You can build postgres and mysql databases using the build_postgresql and build_mysql rake tasks.
== Running the tests
You can run a particular test file from the command line, e.g.
$ ruby test/cases/base_test.rb
To run a specific test:
$ ruby test/cases/base_test.rb -n test_something_works
You can run with a database other than the default you set in test/config.yml, using the ARCONN
environment variable:
$ ARCONN=postgresql ruby test/cases/base_test.rb
You can run all the tests for a given database via rake:
To setup the testing environment for PostgreSQL use this command:
rake postgresql:build_databases
The incantation for running a particular test looks like this
rake test TEST=test/cases/datatype_test_postgresql.rb TESTOPTS="--name=test_timestamp_with_zone_values_without_rails_time_zone_support"