From 264aa82597b013ac31beedc0205272905c7cfe29 Mon Sep 17 00:00:00 2001 From: David McDonald Date: Thu, 7 Nov 2019 11:44:00 -0500 Subject: [PATCH 1/2] corrected syntax for DEPRECATED warnings in test/cases --- Gemfile | 2 +- test/cases/coerced_tests.rb | 13 ++++++++++--- test/cases/schema_dumper_test_sqlserver.rb | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index f27143d4d..ceaca8990 100644 --- a/Gemfile +++ b/Gemfile @@ -51,7 +51,7 @@ group :tinytds do end group :development do - gem 'byebug' + gem 'byebug', platform: [:mri, :mingw, :x64_mingw] gem 'mocha' gem 'minitest-spec-rails' end diff --git a/test/cases/coerced_tests.rb b/test/cases/coerced_tests.rb index 6dff353b7..79365aa95 100644 --- a/test/cases/coerced_tests.rb +++ b/test/cases/coerced_tests.rb @@ -295,7 +295,7 @@ def test_add_column_without_limit_coerced module ActiveRecord class Migration - class ColumnsTest + class ColumnsTest < ActiveRecord::TestCase # Our defaults are real 70000 integers vs '70000' strings. coerce_tests! :test_rename_column_preserves_default_value_not_null def test_rename_column_preserves_default_value_not_null_coerced @@ -525,9 +525,8 @@ def test_condition_local_time_interpolation_with_default_timezone_utc_coerced end end end -end - +end module ActiveRecord @@ -778,6 +777,14 @@ def test_reverse_arel_assoc_order_with_function_coerced topics = Topic.order(Arel.sql("LEN(title)") => :asc).reverse_order assert_equal topics(:second).title, topics.first.title end + + coerce_tests! :test_pluck_with_from_includes_quoted_original_table_name + def test_pluck_with_from_includes_quoted_original_table_name_coerced + relations = Post.joins(:author).order(:id) + subquery = Post.from("#{Post.quoted_table_name} /*! USE INDEX (PRIMARY) */").includes(:author).order(:id) + assert_equal relations.pluck(:id), subquery.pluck(:id) + end + end class ActiveRecord::RelationTest < ActiveRecord::TestCase diff --git a/test/cases/schema_dumper_test_sqlserver.rb b/test/cases/schema_dumper_test_sqlserver.rb index 47b96cff3..a72438e2a 100644 --- a/test/cases/schema_dumper_test_sqlserver.rb +++ b/test/cases/schema_dumper_test_sqlserver.rb @@ -168,7 +168,7 @@ def assert_line(column_name, options={}) if expected.nil? _(actual).must_be_nil message elsif expected.is_a?(Array) - actual.must_include expected, message + _(actual).must_include expected, message elsif expected.is_a?(Float) _(actual).must_be_close_to expected, 0.001 elsif expected.is_a?(Proc) From 7683ff70123b50c3a1727b3f2fd116ce9c9e3ca3 Mon Sep 17 00:00:00 2001 From: David McDonald Date: Thu, 7 Nov 2019 11:44:00 -0500 Subject: [PATCH 2/2] corrected syntax for DEPRECATED warnings in test/cases --- test/cases/coerced_tests.rb | 7 ------- 1 file changed, 7 deletions(-) diff --git a/test/cases/coerced_tests.rb b/test/cases/coerced_tests.rb index 79365aa95..ae41d4962 100644 --- a/test/cases/coerced_tests.rb +++ b/test/cases/coerced_tests.rb @@ -778,13 +778,6 @@ def test_reverse_arel_assoc_order_with_function_coerced assert_equal topics(:second).title, topics.first.title end - coerce_tests! :test_pluck_with_from_includes_quoted_original_table_name - def test_pluck_with_from_includes_quoted_original_table_name_coerced - relations = Post.joins(:author).order(:id) - subquery = Post.from("#{Post.quoted_table_name} /*! USE INDEX (PRIMARY) */").includes(:author).order(:id) - assert_equal relations.pluck(:id), subquery.pluck(:id) - end - end class ActiveRecord::RelationTest < ActiveRecord::TestCase