Skip to content

Commit 77e9d6b

Browse files
committed
Allow full test suite to run. Debug'able coerced_tests
1 parent a841d98 commit 77e9d6b

File tree

2 files changed

+6
-32
lines changed

2 files changed

+6
-32
lines changed

test/cases/coerced_tests.rb

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ module ActiveRecord
103103
class BindParameterTest < ActiveRecord::TestCase
104104

105105
# Never finds `sql` since we use `EXEC sp_executesql` wrappers.
106-
coerce_tests! :test_binds_are_logged,
107-
:test_binds_are_logged_after_type_cast
106+
coerce_tests! :test_binds_are_logged
108107

109108
end
110109
end
@@ -404,19 +403,6 @@ def test_eager_load_belongs_to_primary_key_quoting_coerced
404403

405404

406405

407-
class BigNumber < ActiveRecord::Base
408-
attribute :value_of_e, Type::SQLServer::Integer.new
409-
attribute :my_house_population, Type::SQLServer::Integer.new
410-
end
411-
class MigrationTest < ActiveRecord::TestCase
412-
413-
# PENDING: [Rails5.x] Remove coerced tests and use simple symbol types.
414-
coerce_tests! :test_add_table_with_decimals
415-
416-
end
417-
418-
419-
420406

421407
class NamedScopingTest < ActiveRecord::TestCase
422408

@@ -671,22 +657,6 @@ class TransactionIsolationTest < ActiveRecord::TestCase
671657
end
672658

673659

674-
require 'models/post'
675-
module ActiveRecord
676-
class WhereChainTest < ActiveRecord::TestCase
677-
678-
coerce_tests! :test_not_eq_with_array_parameter
679-
def test_not_eq_with_array_parameter_coerced
680-
expected = Arel::Nodes::Not.new("title = N'hello'")
681-
relation = Post.where.not(['title = ?', 'hello'])
682-
assert_equal([expected], relation.where_values)
683-
end
684-
685-
end
686-
end
687-
688-
689-
690660

691661
class ViewWithPrimaryKeyTest < ActiveRecord::TestCase
692662

test/support/coerceable_test_sqlserver.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ def coerced_test_warning(method)
3434
method = instance_methods(false).select { |m| m =~ method } if method.is_a?(Regexp)
3535
Array(method).each do |m|
3636
result = undef_method(m) if m && method_defined?(m)
37-
STDOUT.puts "Info: Undefined coerced test: #{self.name}##{m}" unless result.blank?
37+
if result.blank?
38+
STDOUT.puts "Warning: Unfound coerced test: #{self.name}##{m}"
39+
else
40+
STDOUT.puts "Info: Undefined coerced test: #{self.name}##{m}"
41+
end
3842
end
3943
end
4044

0 commit comments

Comments
 (0)