Skip to content

Commit e6ab288

Browse files
Merge pull request rails#46456 from jonathanhefner/follow-up-46330-and-46337
Add missing `assert_not_deprecated` deprecator args
2 parents fbad90f + 8a7aba0 commit e6ab288

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

activerecord/test/cases/adapters/mysql2/mysql2_adapter_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def close
6161
)
6262
end
6363

64-
assert_not_deprecated do
64+
assert_not_deprecated(ActiveRecord.deprecator) do
6565
ActiveRecord::ConnectionAdapters::Mysql2Adapter.new(
6666
fake_connection,
6767
ActiveRecord::Base.logger,

activerecord/test/cases/calculations_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ def test_should_count_field_of_root_table_with_conflicting_group_by_column
666666
end
667667

668668
def test_count_with_no_parameters_isnt_deprecated
669-
assert_not_deprecated { Account.count }
669+
assert_not_deprecated(ActiveRecord.deprecator) { Account.count }
670670
end
671671

672672
def test_count_with_too_many_parameters_raises

activerecord/test/cases/connection_adapters/connection_handler_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def test_establish_connection_with_primary_works_without_deprecation
114114

115115
@handler.establish_connection(:primary)
116116

117-
assert_not_deprecated do
117+
assert_not_deprecated(ActiveRecord.deprecator) do
118118
@handler.retrieve_connection("primary")
119119
@handler.remove_connection_pool("primary")
120120
end

activerecord/test/cases/locking_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ def test_locking_in_after_save_callback
716716
assert_nothing_raised do
717717
frog = ::Frog.create(name: "Old Frog")
718718
frog.name = "New Frog"
719-
assert_not_deprecated do
719+
assert_not_deprecated(ActiveRecord.deprecator) do
720720
frog.save!
721721
end
722722
end

activerecord/test/cases/transactions_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def test_rollback_on_ruby_timeout
279279
end
280280

281281
def test_early_return_from_transaction
282-
assert_not_deprecated do
282+
assert_not_deprecated(ActiveRecord.deprecator) do
283283
@first.with_lock do
284284
break
285285
end

activesupport/test/core_ext/date_and_time_compatibility_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,11 @@ def test_string_to_time_frozen_does_not_preserve_time_zone
276276
def test_to_time_preserves_timezone_is_deprecated
277277
current_preserve_tz = ActiveSupport.to_time_preserves_timezone
278278

279-
assert_not_deprecated do
279+
assert_not_deprecated(ActiveSupport.deprecator) do
280280
ActiveSupport.to_time_preserves_timezone
281281
end
282282

283-
assert_not_deprecated do
283+
assert_not_deprecated(ActiveSupport.deprecator) do
284284
ActiveSupport.to_time_preserves_timezone = true
285285
end
286286

activesupport/test/core_ext/digest/uuid_test.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def test_constants
1313

1414
def test_v3_uuids_with_rfc4122_namespaced_uuids_enabled
1515
with_use_rfc4122_namespaced_uuids_set do
16-
assert_not_deprecated do
16+
assert_not_deprecated(ActiveSupport.deprecator) do
1717
assert_equal "3d813cbb-47fb-32ba-91df-831e1593ac29", Digest::UUID.uuid_v3("6BA7B810-9DAD-11D1-80B4-00C04FD430C8", "www.widgets.com")
1818
assert_equal "3d813cbb-47fb-32ba-91df-831e1593ac29", Digest::UUID.uuid_v3("6ba7b810-9dad-11d1-80b4-00c04fd430c8", "www.widgets.com")
1919
assert_equal "3d813cbb-47fb-32ba-91df-831e1593ac29", Digest::UUID.uuid_v3(Digest::UUID::DNS_NAMESPACE, "www.widgets.com")
@@ -46,7 +46,7 @@ def test_v3_uuids_with_rfc4122_namespaced_uuids_disabled
4646
assert_equal "fe5a52d1-703f-3326-b919-2d96003288f3", Digest::UUID.uuid_v3("6ba7b810-9dad-11d1-80b4-00c04fd430c8", "www.widgets.com")
4747
end
4848

49-
assert_not_deprecated do
49+
assert_not_deprecated(ActiveSupport.deprecator) do
5050
assert_equal "3d813cbb-47fb-32ba-91df-831e1593ac29", Digest::UUID.uuid_v3(Digest::UUID::DNS_NAMESPACE, "www.widgets.com")
5151
end
5252

@@ -58,7 +58,7 @@ def test_v3_uuids_with_rfc4122_namespaced_uuids_disabled
5858
assert_equal "2676127a-9073-36e3-b9db-14bc16b7c083", Digest::UUID.uuid_v3("6ba7b811-9dad-11d1-80b4-00c04fd430c8", "http://www.widgets.com")
5959
end
6060

61-
assert_not_deprecated do
61+
assert_not_deprecated(ActiveSupport.deprecator) do
6262
assert_equal "86df55fb-428e-3843-8583-ba3c05f290bc", Digest::UUID.uuid_v3(Digest::UUID::URL_NAMESPACE, "http://www.widgets.com")
6363
end
6464

@@ -70,7 +70,7 @@ def test_v3_uuids_with_rfc4122_namespaced_uuids_disabled
7070
assert_equal "719357e1-54f1-3930-8113-a1faffde48fa", Digest::UUID.uuid_v3("6ba7b812-9dad-11d1-80b4-00c04fd430c8", "1.2.3")
7171
end
7272

73-
assert_not_deprecated do
73+
assert_not_deprecated(ActiveSupport.deprecator) do
7474
assert_equal "8c29ab0e-a2dc-3482-b5eb-20cb2e2387a1", Digest::UUID.uuid_v3(Digest::UUID::OID_NAMESPACE, "1.2.3")
7575
end
7676

@@ -82,7 +82,7 @@ def test_v3_uuids_with_rfc4122_namespaced_uuids_disabled
8282
assert_equal "32560c4a-c9f1-3974-9c1c-5e52761e091f", Digest::UUID.uuid_v3("6ba7b814-9dad-11d1-80b4-00c04fd430c8", "cn=John Doe, ou=People, o=Acme, Inc., c=US")
8383
end
8484

85-
assert_not_deprecated do
85+
assert_not_deprecated(ActiveSupport.deprecator) do
8686
assert_equal "ee49149d-53a4-304a-890b-468229f6afc3", Digest::UUID.uuid_v3(Digest::UUID::X500_NAMESPACE, "cn=John Doe, ou=People, o=Acme, Inc., c=US")
8787
end
8888

@@ -93,7 +93,7 @@ def test_v3_uuids_with_rfc4122_namespaced_uuids_disabled
9393

9494
def test_v5_uuids_with_rfc4122_namespaced_uuids_enabled
9595
with_use_rfc4122_namespaced_uuids_set do
96-
assert_not_deprecated do
96+
assert_not_deprecated(ActiveSupport.deprecator) do
9797
assert_equal "21f7f8de-8051-5b89-8680-0195ef798b6a", Digest::UUID.uuid_v5("6BA7B810-9DAD-11D1-80B4-00C04FD430C8", "www.widgets.com")
9898
assert_equal "21f7f8de-8051-5b89-8680-0195ef798b6a", Digest::UUID.uuid_v5("6ba7b810-9dad-11d1-80b4-00c04fd430c8", "www.widgets.com")
9999
assert_equal "21f7f8de-8051-5b89-8680-0195ef798b6a", Digest::UUID.uuid_v5(Digest::UUID::DNS_NAMESPACE, "www.widgets.com")
@@ -126,7 +126,7 @@ def test_v5_uuids_with_rfc4122_namespaced_uuids_disabled
126126
assert_equal "027963ef-431c-5670-ab2c-820168da74e9", Digest::UUID.uuid_v5("6ba7b810-9dad-11d1-80b4-00c04fd430c8", "www.widgets.com")
127127
end
128128

129-
assert_not_deprecated do
129+
assert_not_deprecated(ActiveSupport.deprecator) do
130130
assert_equal "21f7f8de-8051-5b89-8680-0195ef798b6a", Digest::UUID.uuid_v5(Digest::UUID::DNS_NAMESPACE, "www.widgets.com")
131131
end
132132

@@ -138,7 +138,7 @@ def test_v5_uuids_with_rfc4122_namespaced_uuids_disabled
138138
assert_equal "d8e1e518-2337-58e5-bf52-6c563631db90", Digest::UUID.uuid_v5("6ba7b811-9dad-11d1-80b4-00c04fd430c8", "http://www.widgets.com")
139139
end
140140

141-
assert_not_deprecated do
141+
assert_not_deprecated(ActiveSupport.deprecator) do
142142
assert_equal "4e570fd8-186d-5a74-90f0-4d28e34673a1", Digest::UUID.uuid_v5(Digest::UUID::URL_NAMESPACE, "http://www.widgets.com")
143143
end
144144

@@ -150,7 +150,7 @@ def test_v5_uuids_with_rfc4122_namespaced_uuids_disabled
150150
assert_equal "b9b86653-48bb-5059-861a-2c72974b5c8d", Digest::UUID.uuid_v5("6ba7b812-9dad-11d1-80b4-00c04fd430c8", "1.2.3")
151151
end
152152

153-
assert_not_deprecated do
153+
assert_not_deprecated(ActiveSupport.deprecator) do
154154
assert_equal "42d5e23b-3a02-5135-85c6-52d1102f1f00", Digest::UUID.uuid_v5(Digest::UUID::OID_NAMESPACE, "1.2.3")
155155
end
156156

@@ -162,7 +162,7 @@ def test_v5_uuids_with_rfc4122_namespaced_uuids_disabled
162162
assert_equal "e84a8a4e-a5c7-55b8-ad09-020c0b5662a7", Digest::UUID.uuid_v5("6ba7b814-9dad-11d1-80b4-00c04fd430c8", "cn=John Doe, ou=People, o=Acme, Inc., c=US")
163163
end
164164

165-
assert_not_deprecated do
165+
assert_not_deprecated(ActiveSupport.deprecator) do
166166
assert_equal "fd5b2ddf-bcfe-58b6-90d6-db50f74db527", Digest::UUID.uuid_v5(Digest::UUID::X500_NAMESPACE, "cn=John Doe, ou=People, o=Acme, Inc., c=US")
167167
end
168168

activesupport/test/core_ext/time_with_zone_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def test_to_yaml
206206
EOF
207207

208208
# TODO: Remove assertion in Rails 7.1
209-
assert_not_deprecated do
209+
assert_not_deprecated(ActiveSupport.deprecator) do
210210
assert_equal(yaml, @twz.to_yaml)
211211
end
212212
end
@@ -222,7 +222,7 @@ def test_ruby_to_yaml
222222
EOF
223223

224224
# TODO: Remove assertion in Rails 7.1
225-
assert_not_deprecated do
225+
assert_not_deprecated(ActiveSupport.deprecator) do
226226
assert_equal(yaml, { "twz" => @twz }.to_yaml)
227227
end
228228
end

0 commit comments

Comments
 (0)