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

32 lines
898 B
Text
Raw Normal View History

== Setup
If you don't have the environment set make sure to read
http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#testing-active-record.
== Running the Tests
You can run a particular test file from the command line, e.g.
2011-06-09 04:11:26 -04:00
$ ruby -Itest test/cases/base_test.rb
To run a specific test:
2011-06-09 04:11:26 -04:00
$ 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:
2011-06-09 04:11:26 -04:00
$ ARCONN=postgresql ruby -Itest test/cases/base_test.rb
You can run all the tests for a given database via rake:
2011-06-09 04:11:26 -04:00
$ rake test_mysql
2011-06-09 04:11:26 -04:00
The 'rake test' task will run all the tests for mysql, mysql2, sqlite3 and postgresql.
== Custom 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.