Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 39 lines (25 sloc) 1.595 kb
db045db @dhh Initial
dhh authored
1 == Creating the test database
2
3270c58 @spastorino Deletes trailing whitespaces (over text files only find * -type f -ex…
spastorino authored
3 The default names for the test databases are "activerecord_unittest" and
4 "activerecord_unittest2". If you want to use another database name then be sure
5 to update the connection adapter setups you want to test with in
6 test/connections/<your database>/connection.rb.
7 When you have the database online, you can import the fixture tables with
39814fc @jeremy Merge branch 'ar-test-cleanup' of git://git.geeksomnia.com/rails
jeremy authored
8 the test/schema/*.sql files.
db045db @dhh Initial
dhh authored
9
3270c58 @spastorino Deletes trailing whitespaces (over text files only find * -type f -ex…
spastorino authored
10 Make sure that you create database objects with the same user that you specified in
9a929b6 @dhh Finished polishing API docs
dhh authored
11 connection.rb otherwise (on Postgres, at least) tests for default values will fail.
db045db @dhh Initial
dhh authored
12
13 == Running with Rake
14
15 The easiest way to run the unit tests is through Rake. The default task runs
16 the entire test suite for all the adapters. You can also run the suite on just
e090898 @dcrec1 fixed typo in RUNNING_UNIT_TESTS
dcrec1 authored
17 one adapter by using the tasks test_mysql, test_sqlite3, test_postgresql or any
54e86cc @jeremy Update RUNNING_UNIT_TESTS for current Rake tasks. Closes #6349.
jeremy authored
18 of the other test_ tasks. For more information, checkout the full array of rake
19 tasks with "rake -T"
db045db @dhh Initial
dhh authored
20
21 Rake can be found at http://rake.rubyforge.org
22
23 == Running by hand
24
3270c58 @spastorino Deletes trailing whitespaces (over text files only find * -type f -ex…
spastorino authored
25 Unit tests are located in test/cases directory. If you only want to run a single test suite,
0d0fd21 @NZKoz Update the instructions for running tests.
NZKoz authored
26 you can do so with:
db045db @dhh Initial
dhh authored
27
533da24 @lifo Make sure ActiveRecord tests can run individually. Closes #11425 [the…
lifo authored
28 rake test_mysql TEST=test/cases/base_test.rb
3270c58 @spastorino Deletes trailing whitespaces (over text files only find * -type f -ex…
spastorino authored
29
96980bd @dhh Added change_table for migrations (Jeff Dean) [#71 state:resolved]
dhh authored
30 That'll run the base suite using the MySQL-Ruby adapter. Some tests rely on the schema
31 being initialized - you can initialize the schema with:
32
33 rake test_mysql TEST=test/cases/aaa_create_tables_test.rb
db045db @dhh Initial
dhh authored
34
12eef93 @fxn documents how to run an individual test in AR
fxn authored
35 The incantation for running a particular test looks like this
784165e @dhh Fixed a few Oracle issues: Allows Oracle's odd date handling to still…
dhh authored
36
12eef93 @fxn documents how to run an individual test in AR
fxn authored
37 ruby -w -I"lib:test:test/connections/native_postgresql" test/cases/datatype_test_postgresql.rb -n test_timestamp_with_zone_values_without_rails_time_zone_support
784165e @dhh Fixed a few Oracle issues: Allows Oracle's odd date handling to still…
dhh authored
38
Something went wrong with that request. Please try again.