public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Remove SQL Server cases from tests for latest adapter work to pass rails 
expected behavior.

Signed-off-by: Michael Koziarski <michael@koziarski.com>
metaskills (author)
Wed Nov 19 08:09:44 -0800 2008
NZKoz (committer)
Wed Nov 19 09:00:56 -0800 2008
commit  8e4624be9e55cd0865b307be70a1e6287ec033ca
tree    474283fdde50c0ef8a3c5ced93668753c8a2da13
parent  aeae79dc450598d2e12d5b38472d6dd2b1a4abd7
...
3
4
5
6
 
7
8
9
10
 
11
12
13
...
3
4
5
 
6
7
 
 
 
8
9
10
11
0
@@ -3,11 +3,9 @@ require "active_support/test_case"
0
 module ActiveRecord
0
   class TestCase < ActiveSupport::TestCase #:nodoc:
0
     def assert_date_from_db(expected, actual, message = nil)
0
-      # SQL Server doesn't have a separate column type just for dates,
0
+      # SybaseAdapter doesn't have a separate column type just for dates,
0
       # so the time is in the string and incorrectly formatted
0
-      if current_adapter?(:SQLServerAdapter)
0
-        assert_equal expected.strftime("%Y/%m/%d 00:00:00"), actual.strftime("%Y/%m/%d 00:00:00")
0
-      elsif current_adapter?(:SybaseAdapter)
0
+      if current_adapter?(:SybaseAdapter)
0
         assert_equal expected.to_s, actual.to_date.to_s, message
0
       else
0
         assert_equal expected.to_s, actual.to_s, message
...
667
668
669
670
 
671
672
673
...
667
668
669
 
670
671
672
673
0
@@ -667,7 +667,7 @@ class EagerAssociationTest < ActiveRecord::TestCase
0
   end
0
 
0
   def test_count_with_include
0
-    if current_adapter?(:SQLServerAdapter, :SybaseAdapter)
0
+    if current_adapter?(:SybaseAdapter)
0
       assert_equal 3, authors(:david).posts_with_comments.count(:conditions => "len(comments.body) > 15")
0
     elsif current_adapter?(:OpenBaseAdapter)
0
       assert_equal 3, authors(:david).posts_with_comments.count(:conditions => "length(FETCHBLOB(comments.body)) > 15")
...
428
429
430
431
432
433
434
435
436
...
777
778
779
780
781
 
 
782
783
784
...
1157
1158
1159
1160
1161
 
 
1162
1163
1164
...
1874
1875
1876
1877
 
1878
1879
1880
...
428
429
430
 
 
 
431
432
433
...
774
775
776
 
 
777
778
779
780
781
...
1154
1155
1156
 
 
1157
1158
1159
1160
1161
...
1871
1872
1873
 
1874
1875
1876
1877
0
@@ -428,9 +428,6 @@ class BasicsTest < ActiveRecord::TestCase
0
   end
0
 
0
   def test_preserving_date_objects
0
-    # SQL Server doesn't have a separate column type just for dates, so all are returned as time
0
-    return true if current_adapter?(:SQLServerAdapter)
0
-
0
     if current_adapter?(:SybaseAdapter, :OracleAdapter)
0
       # Sybase ctlib does not (yet?) support the date type; use datetime instead.
0
       # Oracle treats all dates/times as Time.
0
@@ -777,8 +774,8 @@ class BasicsTest < ActiveRecord::TestCase
0
     end
0
   end
0
 
0
-  # Oracle, SQLServer, and Sybase do not have a TIME datatype.
0
-  unless current_adapter?(:SQLServerAdapter, :OracleAdapter, :SybaseAdapter)
0
+  # Oracle, and Sybase do not have a TIME datatype.
0
+  unless current_adapter?(:OracleAdapter, :SybaseAdapter)
0
     def test_utc_as_time_zone
0
       Topic.default_timezone = :utc
0
       attributes = { "bonus_time" => "5:42:00AM" }
0
@@ -1157,8 +1154,8 @@ class BasicsTest < ActiveRecord::TestCase
0
   end
0
 
0
   def test_attributes_on_dummy_time
0
-    # Oracle, SQL Server, and Sybase do not have a TIME datatype.
0
-    return true if current_adapter?(:SQLServerAdapter, :OracleAdapter, :SybaseAdapter)
0
+    # Oracle, and Sybase do not have a TIME datatype.
0
+    return true if current_adapter?(:OracleAdapter, :SybaseAdapter)
0
 
0
     attributes = {
0
       "bonus_time" => "5:42:00AM"
0
@@ -1874,7 +1871,7 @@ class BasicsTest < ActiveRecord::TestCase
0
     assert_equal "integer", xml.elements["//parent-id"].attributes['type']
0
     assert_equal "true", xml.elements["//parent-id"].attributes['nil']
0
 
0
-    if current_adapter?(:SybaseAdapter, :SQLServerAdapter, :OracleAdapter)
0
+    if current_adapter?(:SybaseAdapter, :OracleAdapter)
0
       assert_equal last_read_in_current_timezone, xml.elements["//last-read"].text
0
       assert_equal "datetime" , xml.elements["//last-read"].attributes['type']
0
     else
...
1
2
3
4
5
6
7
8
9
10
 
11
12
13
...
1
2
3
 
 
 
 
4
5
 
6
7
8
9
0
@@ -1,13 +1,9 @@
0
 require "cases/helper"
0
 
0
 # Without using prepared statements, it makes no sense to test
0
-# BLOB data with SQL Server, because the length of a statement is
0
-# limited to 8KB.
0
-#
0
-# Without using prepared statements, it makes no sense to test
0
 # BLOB data with DB2 or Firebird, because the length of a statement
0
 # is limited to 32KB.
0
-unless current_adapter?(:SQLServerAdapter, :SybaseAdapter, :DB2Adapter, :FirebirdAdapter)
0
+unless current_adapter?(:SybaseAdapter, :DB2Adapter, :FirebirdAdapter)
0
   require 'models/binary'
0
 
0
   class BinaryTest < ActiveRecord::TestCase
...
78
79
80
81
 
82
83
84
...
78
79
80
 
81
82
83
84
0
@@ -78,7 +78,7 @@ class DefaultTest < ActiveRecord::TestCase
0
     end
0
   end
0
 
0
-  if current_adapter?(:PostgreSQLAdapter, :SQLServerAdapter, :FirebirdAdapter, :OpenBaseAdapter, :OracleAdapter)
0
+  if current_adapter?(:PostgreSQLAdapter, :FirebirdAdapter, :OpenBaseAdapter, :OracleAdapter)
0
     def test_default_integers
0
       default = Default.new
0
       assert_instance_of Fixnum, default.positive_integer
...
59
60
61
62
 
63
64
65
66
67
68
 
69
70
71
...
59
60
61
 
62
63
64
65
66
67
 
68
69
70
71
0
@@ -59,13 +59,13 @@ class InheritanceTest < ActiveRecord::TestCase
0
 
0
   def test_a_bad_type_column
0
     #SQLServer need to turn Identity Insert On before manually inserting into the Identity column
0
-    if current_adapter?(:SQLServerAdapter, :SybaseAdapter)
0
+    if current_adapter?(:SybaseAdapter)
0
       Company.connection.execute "SET IDENTITY_INSERT companies ON"
0
     end
0
     Company.connection.insert "INSERT INTO companies (id, #{QUOTED_TYPE}, name) VALUES(100, 'bad_class!', 'Not happening')"
0
 
0
     #We then need to turn it back Off before continuing.
0
-    if current_adapter?(:SQLServerAdapter, :SybaseAdapter)
0
+    if current_adapter?(:SybaseAdapter)
0
       Company.connection.execute "SET IDENTITY_INSERT companies OFF"
0
     end
0
     assert_raises(ActiveRecord::SubclassNotFound) { Company.find(100) }
...
200
201
202
203
 
204
205
 
206
207
208
...
200
201
202
 
203
204
 
205
206
207
208
0
@@ -200,9 +200,9 @@ end
0
 # blocks, so separate script called by Kernel#system is needed.
0
 # (See exec vs. async_exec in the PostgreSQL adapter.)
0
 
0
-# TODO: The SQL Server, Sybase, and OpenBase adapters currently have no support for pessimistic locking
0
+# TODO: The Sybase, and OpenBase adapters currently have no support for pessimistic locking
0
 
0
-unless current_adapter?(:SQLServerAdapter, :SybaseAdapter, :OpenBaseAdapter)
0
+unless current_adapter?(:SybaseAdapter, :OpenBaseAdapter)
0
   class PessimisticLockingTest < ActiveRecord::TestCase
0
     self.use_transactional_fixtures = false
0
     fixtures :people, :readers
...
271
272
273
274
 
275
276
 
277
278
279
...
410
411
412
413
 
414
415
416
...
851
852
853
854
855
856
857
858
859
860
...
271
272
273
 
274
275
 
276
277
278
279
...
410
411
412
 
413
414
415
416
...
851
852
853
 
 
 
 
854
855
856
0
@@ -271,9 +271,9 @@ if ActiveRecord::Base.connection.supports_migrations?
0
       Person.connection.drop_table table_name rescue nil
0
     end
0
 
0
-    # SQL Server, Sybase, and SQLite3 will not allow you to add a NOT NULL
0
+    # Sybase, and SQLite3 will not allow you to add a NOT NULL
0
     # column to a table without a default value.
0
-    unless current_adapter?(:SQLServerAdapter, :SybaseAdapter, :SQLiteAdapter)
0
+    unless current_adapter?(:SybaseAdapter, :SQLiteAdapter)
0
       def test_add_column_not_null_without_default
0
         Person.connection.create_table :testings do |t|
0
           t.column :foo, :string
0
@@ -410,7 +410,7 @@ if ActiveRecord::Base.connection.supports_migrations?
0
       assert_equal Fixnum, bob.age.class
0
       assert_equal Time, bob.birthday.class
0
 
0
-      if current_adapter?(:SQLServerAdapter, :OracleAdapter, :SybaseAdapter)
0
+      if current_adapter?(:OracleAdapter, :SybaseAdapter)
0
         # Sybase, and Oracle don't differentiate between date/time
0
         assert_equal Time, bob.favorite_day.class
0
       else
0
@@ -851,10 +851,6 @@ if ActiveRecord::Base.connection.supports_migrations?
0
         # - SQLite3 stores a float, in violation of SQL
0
         assert_kind_of BigDecimal, b.value_of_e
0
         assert_equal BigDecimal("2.71828182845905"), b.value_of_e
0
-      elsif current_adapter?(:SQLServer)
0
-        # - SQL Server rounds instead of truncating
0
-        assert_kind_of Fixnum, b.value_of_e
0
-        assert_equal 3, b.value_of_e
0
       else
0
         # - SQL standard is an integer
0
         assert_kind_of Fixnum, b.value_of_e

Comments

gaffo Mon Nov 24 08:13:21 -0800 2008

Was this to disable SQLServer as not working or because the SQLServer adapter got smarter?

NZKoz Mon Nov 24 09:50:31 -0800 2008

It was to make SQL Server run all the tests as yes, the adapter got a bunch smarter.