]> git.openstreetmap.org Git - rails.git/blob - vendor/gems/composite_primary_keys-2.2.2/test/README_tests.txt
66fe21f2ebb2257095919e77faf04a6755fd4340
[rails.git] / vendor / gems / composite_primary_keys-2.2.2 / test / README_tests.txt
1 = Composite Primary Keys - Testing Readme
2
3 == Testing an adapter
4
5 There are tests available for the following adapters:
6
7 * ibmdb
8 * mysql
9 * oracle
10 * postgresql
11 * sqlite
12
13 To run the tests for on of the adapters, follow these steps (using mysql in the example):
14
15 * rake -T | grep mysql
16
17     rake mysql:build_databases         # Build the MySQL test databases
18     rake mysql:drop_databases          # Drop the MySQL test databases
19     rake mysql:rebuild_databases       # Rebuild the MySQL test databases
20     rake test_mysql                    # Run tests for test_mysql
21
22 * rake mysql:build_databases
23 * rake test_mysql
24
25 == Testing against different ActiveRecord versions (or Edge Rails)
26
27 ActiveRecord is a RubyGem within Rails, and is constantly being improved/changed on
28 its repository (http://dev.rubyonrails.org). These changes may create errors for the CPK
29 gem. So, we need a way to test CPK against Edge Rails, as well as officially released RubyGems.
30
31 The default test (as above) uses the latest RubyGem in your cache.
32
33 You can select an older RubyGem version by running the following:
34
35 * rake ar:set VERSION=1.14.4 test_mysql
36
37 == Edge Rails
38
39 Before you can test CPK against Edge Rails, you must checkout a copy of edge rails somewhere (see http://dev.rubyonrails.org for for examples)
40
41 * cd /path/to/gems
42 * svn co http://svn.rubyonrails.org/rails/trunk rails
43
44 Say the rails folder is /path/to/gems/rails
45
46 Three ways to run CPK tests for Edge Rails:
47
48 i)   Run:
49   
50         EDGE_RAILS_DIR=/path/to/gems/rails rake ar:edge test_mysql
51         
52 ii)  In your .profile, set the environment variable EDGE_RAILS_DIR=/path/to/gems/rails, 
53      and once you reload your profile, run:  
54      
55         rake ar:edge test_mysql
56         
57 iii) Store the path in local/paths.rb. Run:
58
59         cp local/paths.rb.sample local/paths.rb
60         # Now set ENV['EDGE_RAILS_DIR']=/path/to/gems/rails
61         rake ar:edge test_mysql
62
63 These are all variations of the same theme:
64
65 * Set the environment variable EDGE_RAILS_DIR to the path to Rails (which contains the activerecord/lib folder)
66 * Run: rake ar:edge test_<adapter>
67