Skip to content

Commit e53d7c5

Browse files
committed
Coerce all TypeLookupTest like PostgreSQLAdapter. We have our own.
10 - ActiveRecord::ConnectionAdapters::TypeLookupTest 56 failures, 28 errors, 2 skips
1 parent e429ecc commit e53d7c5

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

test/cases/coerced_tests.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,15 @@ def test_types_of_virtual_columns_are_not_changed_on_round_trip_coerced
3535
end
3636

3737
end
38+
39+
40+
module ActiveRecord
41+
module ConnectionAdapters
42+
class TypeLookupTest < ActiveRecord::TestCase
43+
44+
coerce_all_tests! # Just like PostgreSQLAdapter does.
45+
46+
end
47+
end
48+
end
49+

test/cases/helper_sqlserver.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
require 'support/minitest_sqlserver'
44
require 'cases/helper'
55
require 'support/load_schema_sqlserver'
6-
require 'support/coerced_test_sqlserver'
6+
require 'support/coerceable_test_sqlserver'
77
require 'support/sql_counter_sqlserver'
88
require 'mocha/mini_test'
99

1010
module ActiveRecord
1111
class TestCase < ActiveSupport::TestCase
1212

13-
include ARTest::SQLServer::CoercedTest
13+
include ARTest::SQLServer::CoerceableTest
1414

1515
let(:logger) { ActiveRecord::Base.logger }
1616
let(:connection) { ActiveRecord::Base.connection }

test/support/coerced_test_sqlserver.rb renamed to test/support/coerceable_test_sqlserver.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module ARTest
22
module SQLServer
3-
module CoercedTest
3+
module CoerceableTest
44

55
extend ActiveSupport::Concern
66

@@ -22,6 +22,10 @@ def coerce_test!(method)
2222
coerced_test_warning(method)
2323
end
2424

25+
def coerce_all_tests!
26+
instance_methods(false).each { |method| coerce_test!(method) if method.to_s =~ /\Atest/ }
27+
end
28+
2529
def method_added(method)
2630
coerced_test_warning(method) if coerced_tests.include?(method.to_sym)
2731
end

0 commit comments

Comments
 (0)