@@ -8,6 +8,12 @@ test/connections/<your database>/connection.rb.
88
99== Requirements
1010
11+ The following gems need to be installed. Make sure you have gems.github.com as a
12+ source. http://github.com/blog/97-github-loves-rubygems-1-2
13+
14+ * gem install thoughbot-shoulda
15+ * gem install mocha
16+
1117The tests of this adapter depend on the existence of rails edge. All the tests
1218defined by rails edge are re-used. For this to work the following directory
1319structure is assumed to exist:
@@ -31,6 +37,18 @@ of rake tasks with "rake -T"
3137Rake can be found at http://rake.rubyforge.org
3238
3339
40+ == Running with Autotest
41+
42+ Using autotest is easy, just run "autotest" and the tests will run continually in the
43+ same order as the rake test command. By default autotest will use ODBC connection. If
44+ you want to change this you can edit the autotest/sqlserver.rb file and set odbc_mode
45+ to false.
46+
47+ Lastly, you can run autotest on just the adapter specific tests with "autotest sqlserver".
48+ This will continuously run ONLY the SQL Sever specific behavior tests which are much
49+ quicker to run than the entire active record test suite.
50+
51+
3452== Running by hand
3553
3654Unit tests are located in test directory. If you only want to run a single test suite,
@@ -40,6 +58,7 @@ you can do so with:
4058
4159That'll run the base suite using the SQLServer-Ruby adapter.
4260
61+
4362== Expected Errors and Failures
4463
4564Currently we expect the following errors from running the test suite:
@@ -51,20 +70,13 @@ Currently we expect the following errors from running the test suite:
51702. ERROR in test_add_limit_offset_should_sanitize_sql_injection_for_limit_without_comas
5271 from
5372 activerecord/test/cases/adapter_test.rb
54-
55- 3. FAILURE in test_update
56- from
57- activerecord/test/cases/mixin_test.rb
5873
59- 4. FAILURE in test_create
60- from
61- activerecord/test/cases/mixin_test.rb
62-
63- 5. FAILURE in test_many_updates
64- from
65- activerecord/test/cases/mixin_test.rb
66-
67-
74+ 3. Error:
75+ test_delegates_finds_and_calculations_to_the_base_class(NamedScopeTest):
76+ NoMethodError: undefined method `to_d' for 0:Fixnum
77+ http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1346-coerce-0-average-calculation-to-float
78+
79+
68801. & 2. error because we treat the possible values for offset and limit much more
6981aggressively than the intention of the tests. Rails expects that limit => '1,7 bad sql'
7082would turn into ' limit 1,7' but that's not valid SQL Server syntax so why should we
@@ -74,13 +86,4 @@ to sanitize them. It's a hard-line to take on sql injection, but probably a saf
7486We do however have our own offset and limit tests in test/cases/offset_and_limit_test_sqlserver
7587that test our expected behaviour.
7688
77- 3., 4., & 5. error because SQLServer datetimes (the only time data type available) does not
78- store usec values so even storing a fixed Time value in the db and comparing the retrieved
79- value to the know value will not work. The retreived value will always have .usec = 0 (probably).
80-
81- We do however have re-implement the fixed time stuff for activerecord/test/cases/mixin_test.rb in
82- test/cases/mixin_for_sqlserver_test so that the fixed time is a time with 0 usecs.
83-
84- NOTE: Neither do quite a few other adapters. I found that our implementation if the
85- reason for these failures. Have not debuged yet.
8689
0 commit comments