aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source
diff options
context:
space:
mode:
authornachocab <nachocab@gmail.com>2009-03-07 11:15:51 -0700
committernachocab <nachocab@gmail.com>2009-03-07 11:15:51 -0700
commit2e8f9106308a5b72deab9084899b176c8d0760b1 (patch)
treed89b5ea7d5ef0218b26edd9f5472ebc777f81b72 /railties/guides/source
parentcafa3c059780b983c9aaccafd47f010bc280d1cb (diff)
downloadrails-2e8f9106308a5b72deab9084899b176c8d0760b1.tar.gz
rails-2e8f9106308a5b72deab9084899b176c8d0760b1.tar.bz2
rails-2e8f9106308a5b72deab9084899b176c8d0760b1.zip
Added info on how to run rake with different database adapters
Diffstat (limited to 'railties/guides/source')
-rw-r--r--railties/guides/source/contributing_to_rails.textile11
1 files changed, 10 insertions, 1 deletions
diff --git a/railties/guides/source/contributing_to_rails.textile b/railties/guides/source/contributing_to_rails.textile
index b5ae40a8ba..84778ed9ee 100644
--- a/railties/guides/source/contributing_to_rails.textile
+++ b/railties/guides/source/contributing_to_rails.textile
@@ -72,7 +72,16 @@ mysql> GRANT ALL PRIVILEGES ON activerecord_unittest2.*
If you’re using another database, check the files under +activerecord/test/connections+ in the Rails source code for default connection information. You can edit these files if you _must_ on your machine to provide different credentials, but obviously you should not push any such changes back to Rails.
-Now if you go back to the root of the Rails source on your machine and run +rake+ with no parameters, you should see every test in all of the Rails components pass. After that, check out the file +activerecord/RUNNING_UNIT_TESTS+ for information on running more targeted database tests, or the file +ci/ci_build.rb+ to see the test suite that the Rails continuous integration server runs.
+Now if you go back to the root of the Rails source on your machine and run +rake+ with no parameters, you should see every test in all of the Rails components pass. If you want to run the all ActiveRecord tests (or just a single one) with another database adapter, enter this from the +activerecord+ directory:
+
+<shell>
+rake test_sqlite3
+rake test_sqlite3 TEST=test/cases/validations_test.rb
+</shell>
+
+You can change +sqlite3+ with +jdbcmysql+, +jdbcsqlite3+, +jdbcpostgresql+, +mysql+ or +postgresql+. Check out the file +activerecord/RUNNING_UNIT_TESTS+ for information on running more targeted database tests, or the file +ci/ci_build.rb+ to see the test suite that the Rails continuous integration server runs.
+
+
NOTE: If you're working with Active Record code, you _must_ ensure that the tests pass for at least MySQL, PostgreSQL, SQLite 2, and SQLite 3. Subtle differences between the various Active Record database adapters have been behind the rejection of many patches that looked OK when tested only against MySQL.