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
Carlos Antonio da Silva a8dd21d8b4 Remove IdentityMap
2012-03-13 20:08:54 -03: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 postgresql:build_databases and mysql:build_databases rake tasks.
== Running the tests
You can run a particular test file from the command line, e.g.
$ ruby -Itest test/cases/base_test.rb
To run a specific test:
$ ruby -Itest 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 -Itest test/cases/base_test.rb
You can run all the tests for a given database via rake:
$ rake test_mysql
The 'rake test' task will run all the tests for mysql, mysql2, sqlite3 and postgresql.
== 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.