Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

root/adapters/sqlserver/RUNNING_UNIT_TESTS

Revision 7939, 1.4 kB (checked in by lawrence, 1 year ago)

Moving SQL Server tests from AR core to plugin sqlserver adapter. Closes #9884 [lawrence]

Line 
1 == Creating the test database
2
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
8
9 == Requirements
10
11 The tests of this adapter depend on the existence of rails edge. All the tests
12 defined by rails edge are re-used. For this to work the following directory
13 structure is assumed to exist:
14
15 #{RAILS_ROOT}/vendor/plugins/adapters/sqlserver
16 #{RAILS_ROOT}/vendor/rails/activerecord/test
17
18 Define a user named 'rails' in SQL Server with all privileges granted. Use an empty
19 password for user 'rails', or alternatively use the OSQLPASSWORD environment variable
20 which allows you to set a default password for the current session.
21
22 Then run "rake create_databases".
23
24
25 == Running with Rake
26
27 The easiest way to run the unit tests is through Rake. Either run "rake test_sqlserver"
28 or "rake test_sqlserver_odbc". For more information, checkout the full array
29 of rake tasks with "rake -T"
30
31 Rake can be found at http://rake.rubyforge.org
32
33
34 == Running by hand
35
36 Unit tests are located in test directory. If you only want to run a single test suite,
37 you can do so with:
38
39    rake test_sqlserver TEST=base_test.rb
40    
41 That'll run the base suite using the SQLServer-Ruby adapter.
42
43
44
Note: See TracBrowser for help on using the browser.