From 1c99da5cbdb92ed4326e6a51484dcd9387e743e4 Mon Sep 17 00:00:00 2001
From: Jeremy Evans <code@jeremyevans.net>
Date: Sat, 4 Jul 2020 10:02:56 -0700
Subject: [PATCH] Only print keyword deprecation warnings in verbose mode

---
 test/-ext-/funcall/test_passing_block.rb |   8 +-
 test/ruby/test_io.rb                     |   2 +-
 test/ruby/test_keyword.rb                | 884 +++++++++++------------
 test/ruby/test_proc.rb                   |  56 +-
 test/ruby/test_struct.rb                 |   4 +-
 test/ruby/test_syntax.rb                 |   2 +-
 test/test_delegate.rb                    |   2 +-
 vm_args.c                                |   2 +-
 8 files changed, 480 insertions(+), 480 deletions(-)

diff --git a/test/-ext-/funcall/test_passing_block.rb b/test/-ext-/funcall/test_passing_block.rb
index d1164871b0..49249b860d 100644
--- a/test/-ext-/funcall/test_passing_block.rb
+++ b/test/-ext-/funcall/test_passing_block.rb
@@ -29,7 +29,7 @@ def test_with_funcall_passing_block_kw
     assert_equal([[{}], {}], Relay.with_funcall_passing_block_kw(2, {}, **{}, &block))
     assert_equal([[], {a: 1}], Relay.with_funcall_passing_block_kw(3, a: 1, &block))
     assert_equal([[{a: 1}], {}], Relay.with_funcall_passing_block_kw(3, {a: 1}, **{}, &block))
-    assert_warn(/warning: Passing the keyword argument as the last hash parameter is deprecated.*The called method is defined here/m) do
+    assert_warning(/warning: Passing the keyword argument as the last hash parameter is deprecated.*The called method is defined here/m) do
       assert_equal({}, Relay.with_funcall_passing_block_kw(3, **{}, &->(a){a}))
     end
   end
@@ -53,7 +53,7 @@ def o.baz(arg)
     assert_equal([[], {a: 1}], Relay.with_funcallv_public_kw(o, :foo, 3, a: 1))
     assert_equal([[{a: 1}], {}], Relay.with_funcallv_public_kw(o, :foo, 3, {a: 1}, **{}))
     assert_raise(NoMethodError) { Relay.with_funcallv_public_kw(o, :bar, 3, {a: 1}, **{}) }
-    assert_warn(/warning: Passing the keyword argument as the last hash parameter is deprecated.*The called method `baz'/m) do
+    assert_warning(/warning: Passing the keyword argument as the last hash parameter is deprecated.*The called method `baz'/m) do
       assert_equal({}, Relay.with_funcallv_public_kw(o, :baz, 3, **{}))
     end
   end
@@ -64,11 +64,11 @@ def test_with_yield_splat_kw
     assert_equal([[], {a: 1}], Relay.with_yield_splat_kw(1, [{a: 1}], &block))
     assert_equal([[1], {a: 1}], Relay.with_yield_splat_kw(1, [1, {a: 1}], &block))
     assert_equal([[{}], {}], Relay.with_yield_splat_kw(2, [{}], **{}, &block))
-    assert_warn(/warning: Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/warning: Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal([[], {a: 1}], Relay.with_yield_splat_kw(3, [{a: 1}], &block))
     end
     assert_equal([[{a: 1}], {}], Relay.with_yield_splat_kw(3, [{a: 1}], **{}, &block))
-    assert_warn(/warning: Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/warning: Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal({}, Relay.with_yield_splat_kw(3, [], **{}, &->(a){a}))
     end
   end
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index c66446d2e8..91a5aec186 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -2292,7 +2292,7 @@ def o.to_open(**kw); kw; end
       match
     end
 
-    assert_warn(w) do
+    assert_warning(w) do
       assert_equal({:a=>1}, open(o, {a: 1}))
     end
 
diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb
index a0459553ac..f6e882a8d4 100644
--- a/test/ruby/test_keyword.rb
+++ b/test/ruby/test_keyword.rb
@@ -24,7 +24,7 @@ def f2(x, str: "foo", num: 424242)
 
   def test_f2
     assert_equal([:xyz, "foo", 424242], f2(:xyz))
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `f2'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `f2'/m) do
       assert_equal([{"bar"=>42}, "foo", 424242], f2("bar"=>42))
     end
   end
@@ -224,10 +224,10 @@ def c.m; end
     def c.m(args)
       args
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, c.m(**{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, c.m(**kw))
     end
     assert_equal(kw, c.m(kw, **kw))
@@ -248,11 +248,11 @@ def c.m(**args)
     assert_equal(h2, c.m(**h2))
     assert_equal(h3, c.m(**h3))
     assert_equal(h3, c.m(a: 1, **h2))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
       assert_equal(h, c.m(h))
     end
     assert_raise(ArgumentError) { c.m(h2) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
       assert_raise(ArgumentError) { c.m(h3) }
     end
 
@@ -260,25 +260,25 @@ def c.m(**args)
     def c.m(arg, **args)
       [arg, args]
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       c.m(**{})
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       c.m(**kw)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], c.m(**h))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], c.m(a: 1))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h2, kw], c.m(**h2))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], c.m(**h3))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], c.m(a: 1, **h2))
     end
     assert_equal([h, kw], c.m(h))
@@ -296,11 +296,11 @@ def c.m(arg=1, **args)
     assert_equal([1, h2], c.m(**h2))
     assert_equal([1, h3], c.m(**h3))
     assert_equal([1, h3], c.m(a: 1, **h2))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
       assert_equal([1, h], c.m(h))
     end
     assert_equal([h2, kw], c.m(h2))
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
       assert_equal([h2, h], c.m(h3))
     end
   end
@@ -357,11 +357,11 @@ def m(args)
         args
       end
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, c.m(**{}))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, c.m(**kw))
     end
     assert_equal(h, c.m(**h))
@@ -383,11 +383,11 @@ def m(**args)
     assert_equal(h2, c.m(**h2))
     assert_equal(h3, c.m(**h3))
     assert_equal(h3, c.m(a: 1, **h2))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
       assert_equal(h, c.m(h))
     end
     assert_raise(ArgumentError) { c.m(h2) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
       assert_raise(ArgumentError) { c.m(h3) }
     end
 
@@ -398,31 +398,31 @@ def m(arg, **args)
       end
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       c.m(**{})
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       c.m(**kw)
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], c.m(**h))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], c.m(a: 1))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h2, kw], c.m(**h2))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], c.m(**h3))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], c.m(a: 1, **h2))
     end
 
@@ -493,11 +493,11 @@ def m(args)
         args
       end
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, c.m(**{}))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, c.m(**kw))
     end
     assert_equal(h, c.m(**h))
@@ -519,11 +519,11 @@ def m(**args)
     assert_equal(h2, c.m(**h2))
     assert_equal(h3, c.m(**h3))
     assert_equal(h3, c.m(a: 1, **h2))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
       assert_equal(h, c.m(h))
     end
     assert_raise(ArgumentError) { c.m(h2) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
       assert_raise(ArgumentError) { c.m(h3) }
     end
 
@@ -534,31 +534,31 @@ def m(arg, **args)
       end
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       c.m(**{})
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       c.m(**kw)
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], c.m(**h))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], c.m(a: 1))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h2, kw], c.m(**h2))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], c.m(**h3))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], c.m(a: 1, **h2))
     end
 
@@ -592,10 +592,10 @@ def test_lambda_kwsplat_call
     assert_raise(ArgumentError) { f[**h3] }
 
     f = ->(a) { a }
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal(kw, f[**{}])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal(kw, f[**kw])
     end
     assert_equal(h, f[**h])
@@ -612,34 +612,34 @@ def test_lambda_kwsplat_call
     assert_equal(h2, f[**h2])
     assert_equal(h3, f[**h3])
     assert_equal(h3, f[a: 1, **h2])
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `\[\]'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `\[\]'/m) do
       assert_equal(h, f[h])
     end
     assert_raise(ArgumentError) { f[h2] }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `\[\]'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `\[\]'/m) do
       assert_raise(ArgumentError) { f[h3] }
     end
 
     f = ->(a, **x) { [a,x] }
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
       assert_equal([{}, {}], f[**{}])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
       assert_equal([{}, {}], f[**kw])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
       assert_equal([h, {}], f[**h])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
       assert_equal([h, {}], f[a: 1])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
       assert_equal([h2, {}], f[**h2])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
       assert_equal([h3, {}], f[**h3])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
       assert_equal([h3, {}], f[a: 1, **h2])
     end
 
@@ -670,10 +670,10 @@ def test_lambda_method_kwsplat_call
 
     f = ->(a) { a }
     f = f.method(:call)
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal(kw, f[**{}])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal(kw, f[**kw])
     end
     assert_equal(h, f[**h])
@@ -691,35 +691,35 @@ def test_lambda_method_kwsplat_call
     assert_equal(h2, f[**h2])
     assert_equal(h3, f[**h3])
     assert_equal(h3, f[a: 1, **h2])
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(h, f[h])
     end
     assert_raise(ArgumentError) { f[h2] }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
       assert_raise(ArgumentError) { f[h3] }
     end
 
     f = ->(a, **x) { [a,x] }
     f = f.method(:call)
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([{}, {}], f[**{}])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([{}, {}], f[**kw])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h, {}], f[**h])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h, {}], f[a: 1])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h2, {}], f[**h2])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h3, {}], f[**h3])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h3, {}], f[a: 1, **h2])
     end
 
@@ -751,10 +751,10 @@ def test_Thread_new_kwsplat
     assert_raise(ArgumentError) { t.new(**h3, &f).value }
 
     f = ->(a) { a }
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal(kw, t.new(**{}, &f).value)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal(kw, t.new(**kw, &f).value)
     end
     assert_equal(h, t.new(**h, &f).value)
@@ -771,34 +771,34 @@ def test_Thread_new_kwsplat
     assert_equal(h2, t.new(**h2, &f).value)
     assert_equal(h3, t.new(**h3, &f).value)
     assert_equal(h3, t.new(a: 1, **h2, &f).value)
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(h, t.new(h, &f).value)
     end
     assert_raise(ArgumentError) { t.new(h2, &f).value }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
       assert_raise(ArgumentError) { t.new(h3, &f).value }
     end
 
     f = ->(a, **x) { [a,x] }
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([{}, {}], t.new(**{}, &f).value)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([{}, {}], t.new(**kw, &f).value)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h, {}], t.new(**h, &f).value)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h, {}], t.new(a: 1, &f).value)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h2, {}], t.new(**h2, &f).value)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h3, {}], t.new(**h3, &f).value)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h3, {}], t.new(a: 1, **h2, &f).value)
     end
 
@@ -830,10 +830,10 @@ def test_Fiber_resume_kwsplat
     assert_raise(ArgumentError) { t.new(&f).resume(**h3) }
 
     f = ->(a) { a }
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal(kw, t.new(&f).resume(**{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal(kw, t.new(&f).resume(**kw))
     end
     assert_equal(h, t.new(&f).resume(**h))
@@ -850,34 +850,34 @@ def test_Fiber_resume_kwsplat
     assert_equal(h2, t.new(&f).resume(**h2))
     assert_equal(h3, t.new(&f).resume(**h3))
     assert_equal(h3, t.new(&f).resume(a: 1, **h2))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(h, t.new(&f).resume(h))
     end
     assert_raise(ArgumentError) { t.new(&f).resume(h2) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
       assert_raise(ArgumentError) { t.new(&f).resume(h3) }
     end
 
     f = ->(a, **x) { [a,x] }
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([{}, {}], t.new(&f).resume(**{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([{}, {}], t.new(&f).resume(**kw))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h, {}], t.new(&f).resume(**h))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h, {}], t.new(&f).resume(a: 1))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h2, {}], t.new(&f).resume(**h2))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h3, {}], t.new(&f).resume(**h3))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h3, {}], t.new(&f).resume(a: 1, **h2))
     end
 
@@ -907,10 +907,10 @@ def test_Enumerator_Generator_each_kwsplat
     assert_raise(ArgumentError) { g.new(&f).each(**h3) }
 
     f = ->(_, a) { a }
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal(kw, g.new(&f).each(**{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal(kw, g.new(&f).each(**kw))
     end
     assert_equal(h, g.new(&f).each(**h))
@@ -927,34 +927,34 @@ def test_Enumerator_Generator_each_kwsplat
     assert_equal(h2, g.new(&f).each(**h2))
     assert_equal(h3, g.new(&f).each(**h3))
     assert_equal(h3, g.new(&f).each(a: 1, **h2))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(h, g.new(&f).each(h))
     end
     assert_raise(ArgumentError) { g.new(&f).each(h2) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
       assert_raise(ArgumentError) { g.new(&f).each(h3) }
     end
 
     f = ->(_, a, **x) { [a,x] }
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([{}, {}], g.new(&f).each(**{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([{}, {}], g.new(&f).each(**kw))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h, {}], g.new(&f).each(**h))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h, {}], g.new(&f).each(a: 1))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h2, {}], g.new(&f).each(**h2))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h3, {}], g.new(&f).each(**h3))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h3, {}], g.new(&f).each(a: 1, **h2))
     end
 
@@ -984,10 +984,10 @@ def test_Enumerator_Yielder_yield_kwsplat
     assert_raise(ArgumentError) { g.new{|y| y.yield(**h3)}.each(&f) }
 
     f = ->(a) { a }
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal(kw, g.new{|y| y.yield(**{})}.each(&f))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal(kw, g.new{|y| y.yield(**kw)}.each(&f))
     end
     assert_equal(h, g.new{|y| y.yield(**h)}.each(&f))
@@ -1004,34 +1004,34 @@ def test_Enumerator_Yielder_yield_kwsplat
     assert_equal(h2, g.new{|y| y.yield(**h2)}.each(&f))
     assert_equal(h3, g.new{|y| y.yield(**h3)}.each(&f))
     assert_equal(h3, g.new{|y| y.yield(a: 1, **h2)}.each(&f))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(h, g.new{|y| y.yield(h)}.each(&f))
     end
     assert_raise(ArgumentError) { g.new{|y| y.yield(h2)}.each(&f) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
       assert_raise(ArgumentError) { g.new{|y| y.yield(h3)}.each(&f) }
     end
 
     f = ->(a, **x) { [a,x] }
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([{}, {}], g.new{|y| y.yield(**{})}.each(&f))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([{}, {}], g.new{|y| y.yield(**kw)}.each(&f))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h, {}], g.new{|y| y.yield(**h)}.each(&f))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h, {}], g.new{|y| y.yield(a: 1)}.each(&f))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h2, {}], g.new{|y| y.yield(**h2)}.each(&f))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h3, {}], g.new{|y| y.yield(**h3)}.each(&f))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h3, {}], g.new{|y| y.yield(a: 1, **h2)}.each(&f))
     end
 
@@ -1087,10 +1087,10 @@ def initialize(args)
         @args = args
       end
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
       assert_equal(kw, c[**{}].args)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
       assert_equal(kw, c[**kw].args)
     end
     assert_equal(h, c[**h].args)
@@ -1111,11 +1111,11 @@ def initialize(**args)
     assert_equal(h2, c[**h2].args)
     assert_equal(h3, c[**h3].args)
     assert_equal(h3, c[a: 1, **h2].args)
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `initialize'/m) do
       assert_equal(h, c[h].args)
     end
     assert_raise(ArgumentError) { c[h2].args }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `initialize'/m) do
       assert_raise(ArgumentError) { c[h3].args }
     end
 
@@ -1124,25 +1124,25 @@ def initialize(arg, **args)
         @args = [arg, args]
       end
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
       assert_equal([kw, kw], c[**{}].args)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
       assert_equal([kw, kw], c[**kw].args)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
       assert_equal([h, kw], c[**h].args)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
       assert_equal([h, kw], c[a: 1].args)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
       assert_equal([h2, kw], c[**h2].args)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
       assert_equal([h3, kw], c[**h3].args)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
       assert_equal([h3, kw], c[a: 1, **h2].args)
     end
 
@@ -1199,10 +1199,10 @@ def initialize(args)
         @args = args
       end
     end.method(:new)
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
       assert_equal(kw, c[**{}].args)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
       assert_equal(kw, c[**kw].args)
     end
     assert_equal(h, c[**h].args)
@@ -1223,11 +1223,11 @@ def initialize(**args)
     assert_equal(h2, c[**h2].args)
     assert_equal(h3, c[**h3].args)
     assert_equal(h3, c[a: 1, **h2].args)
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `initialize'/m) do
       assert_equal(h, c[h].args)
     end
     assert_raise(ArgumentError) { c[h2].args }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `initialize'/m) do
       assert_raise(ArgumentError) { c[h3].args }
     end
 
@@ -1236,25 +1236,25 @@ def initialize(arg, **args)
         @args = [arg, args]
       end
     end.method(:new)
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
       assert_equal([kw, kw], c[**{}].args)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
       assert_equal([kw, kw], c[**kw].args)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
       assert_equal([h, kw], c[**h].args)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
       assert_equal([h, kw], c[a: 1].args)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
       assert_equal([h2, kw], c[**h2].args)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
       assert_equal([h3, kw], c[**h3].args)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
       assert_equal([h3, kw], c[a: 1, **h2].args)
     end
 
@@ -1304,10 +1304,10 @@ def c.m; end
     def c.m(args)
       args
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, c.method(:m)[**{}])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, c.method(:m)[**kw])
     end
     assert_equal(h, c.method(:m)[**h])
@@ -1327,11 +1327,11 @@ def c.m(**args)
     assert_equal(h2, c.method(:m)[**h2])
     assert_equal(h3, c.method(:m)[**h3])
     assert_equal(h3, c.method(:m)[a: 1, **h2])
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
       assert_equal(h, c.method(:m)[h])
     end
     assert_raise(ArgumentError) { c.method(:m)[h2] }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
       assert_raise(ArgumentError) { c.method(:m)[h3] }
     end
 
@@ -1339,25 +1339,25 @@ def c.m(**args)
     def c.m(arg, **args)
       [arg, args]
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([kw, kw], c.method(:m)[**{}])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([kw, kw], c.method(:m)[**kw])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], c.method(:m)[**h])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], c.method(:m)[a: 1])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h2, kw], c.method(:m)[**h2])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], c.method(:m)[**h3])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], c.method(:m)[a: 1, **h2])
     end
 
@@ -1407,10 +1407,10 @@ def c.m; end
     def c.m(args)
       args
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, sc.instance_method(:m).bind_call(c, **{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, sc.instance_method(:m).bind_call(c, **kw))
     end
     assert_equal(h, sc.instance_method(:m).bind_call(c, **h))
@@ -1430,11 +1430,11 @@ def c.m(**args)
     assert_equal(h2, sc.instance_method(:m).bind_call(c, **h2))
     assert_equal(h3, sc.instance_method(:m).bind_call(c, **h3))
     assert_equal(h3, sc.instance_method(:m).bind_call(c, a: 1, **h2))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
       assert_equal(h, sc.instance_method(:m).bind_call(c, h))
     end
     assert_raise(ArgumentError) { sc.instance_method(:m).bind_call(c, h2) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
       assert_raise(ArgumentError) { sc.instance_method(:m).bind_call(c, h3) }
     end
 
@@ -1442,25 +1442,25 @@ def c.m(**args)
     def c.m(arg, **args)
       [arg, args]
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([kw, kw], sc.instance_method(:m).bind_call(c, **{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([kw, kw], sc.instance_method(:m).bind_call(c, **kw))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], sc.instance_method(:m).bind_call(c, **h))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], sc.instance_method(:m).bind_call(c, a: 1))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h2, kw], sc.instance_method(:m).bind_call(c, **h2))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], sc.instance_method(:m).bind_call(c, **h3))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], sc.instance_method(:m).bind_call(c, a: 1, **h2))
     end
 
@@ -1509,10 +1509,10 @@ def c.m; end
     def c.m(args)
       args
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, c.send(:m, **{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, c.send(:m, **kw))
     end
     assert_equal(h, c.send(:m, **h))
@@ -1532,11 +1532,11 @@ def c.m(**args)
     assert_equal(h2, c.send(:m, **h2))
     assert_equal(h3, c.send(:m, **h3))
     assert_equal(h3, c.send(:m, a: 1, **h2))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
       assert_equal(h, c.send(:m, h))
     end
     assert_raise(ArgumentError) { c.send(:m, h2) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
       assert_raise(ArgumentError) { c.send(:m, h3) }
     end
 
@@ -1544,25 +1544,25 @@ def c.m(**args)
     def c.m(arg, **args)
       [arg, args]
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       c.send(:m, **{})
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       c.send(:m, **kw)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], c.send(:m, **h))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], c.send(:m, a: 1))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h2, kw], c.send(:m, **h2))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], c.send(:m, **h3))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], c.send(:m, a: 1, **h2))
     end
 
@@ -1611,10 +1611,10 @@ def c.m; end
     def c.m(args)
       args
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, c.public_send(:m, **{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, c.public_send(:m, **kw))
     end
     assert_equal(h, c.public_send(:m, **h))
@@ -1634,11 +1634,11 @@ def c.m(**args)
     assert_equal(h2, c.public_send(:m, **h2))
     assert_equal(h3, c.public_send(:m, **h3))
     assert_equal(h3, c.public_send(:m, a: 1, **h2))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
       assert_equal(h, c.public_send(:m, h))
     end
     assert_raise(ArgumentError) { c.public_send(:m, h2) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
       assert_raise(ArgumentError) { c.public_send(:m, h3) }
     end
 
@@ -1646,25 +1646,25 @@ def c.m(**args)
     def c.m(arg, **args)
       [arg, args]
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       c.public_send(:m, **{})
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       c.public_send(:m, **kw)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], c.public_send(:m, **h))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], c.public_send(:m, a: 1))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h2, kw], c.public_send(:m, **h2))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], c.public_send(:m, **h3))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], c.public_send(:m, a: 1, **h2))
     end
 
@@ -1716,10 +1716,10 @@ def c.m(args)
       args
     end
     m = c.method(:send)
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, m.call(:m, **{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, m.call(:m, **kw))
     end
     assert_equal(h, m.call(:m, **h))
@@ -1740,11 +1740,11 @@ def c.m(**args)
     assert_equal(h2, m.call(:m, **h2))
     assert_equal(h3, m.call(:m, **h3))
     assert_equal(h3, m.call(:m, a: 1, **h2))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
       assert_equal(h, m.call(:m, h))
     end
     assert_raise(ArgumentError) { m.call(:m, h2) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
       assert_raise(ArgumentError) { m.call(:m, h3) }
     end
 
@@ -1753,25 +1753,25 @@ def c.m(arg, **args)
       [arg, args]
     end
     m = c.method(:send)
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       m.call(:m, **{})
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       m.call(:m, **kw)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], m.call(:m, **h))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], m.call(:m, a: 1))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h2, kw], m.call(:m, **h2))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], m.call(:m, **h3))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], m.call(:m, a: 1, **h2))
     end
 
@@ -1821,10 +1821,10 @@ def c.m; end
     def c.m(args)
       args
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, :m.to_proc.call(c, **{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, :m.to_proc.call(c, **kw))
     end
     assert_equal(h, :m.to_proc.call(c, **h))
@@ -1844,11 +1844,11 @@ def c.m(**args)
     assert_equal(h2, :m.to_proc.call(c, **h2))
     assert_equal(h3, :m.to_proc.call(c, **h3))
     assert_equal(h3, :m.to_proc.call(c, a: 1, **h2))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
       assert_equal(h, :m.to_proc.call(c, h))
     end
     assert_raise(ArgumentError) { :m.to_proc.call(c, h2) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
       assert_raise(ArgumentError) { :m.to_proc.call(c, h3) }
     end
 
@@ -1856,25 +1856,25 @@ def c.m(**args)
     def c.m(arg, **args)
       [arg, args]
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([kw, kw], :m.to_proc.call(c, **{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([kw, kw], :m.to_proc.call(c, **kw))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], :m.to_proc.call(c, **h))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], :m.to_proc.call(c, a: 1))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h2, kw], :m.to_proc.call(c, **h2))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], :m.to_proc.call(c, **h3))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], :m.to_proc.call(c, a: 1, **h2))
     end
 
@@ -1924,10 +1924,10 @@ def c.m; end
     def c.m(args)
       args
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, m.call(c, **{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, m.call(c, **kw))
     end
     assert_equal(h, m.call(c, **h))
@@ -1947,11 +1947,11 @@ def c.m(**args)
     assert_equal(h2, m.call(c, **h2))
     assert_equal(h3, m.call(c, **h3))
     assert_equal(h3, m.call(c, a: 1, **h2))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
       assert_equal(h, m.call(c, h))
     end
     assert_raise(ArgumentError) { m.call(c, h2) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
       assert_raise(ArgumentError) { m.call(c, h3) }
     end
 
@@ -1959,25 +1959,25 @@ def c.m(**args)
     def c.m(arg, **args)
       [arg, args]
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([kw, kw], m.call(c, **{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([kw, kw], m.call(c, **kw))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], m.call(c, **h))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], m.call(c, a: 1))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h2, kw], m.call(c, **h2))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], m.call(c, **h3))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], m.call(c, a: 1, **h2))
     end
 
@@ -2026,10 +2026,10 @@ def c.method_missing(_); end
     def c.method_missing(_, args)
       args
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal(kw, c.m(**{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal(kw, c.m(**kw))
     end
     assert_equal(h, c.m(**h))
@@ -2049,11 +2049,11 @@ def c.method_missing(_, **args)
     assert_equal(h2, c.m(**h2))
     assert_equal(h3, c.m(**h3))
     assert_equal(h3, c.m(a: 1, **h2))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
       assert_equal(h, c.m(h))
     end
     assert_raise(ArgumentError) { c.m(h2) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `method_missing'/m) do
       assert_raise(ArgumentError) { c.m(h3) }
     end
 
@@ -2061,25 +2061,25 @@ def c.method_missing(_, **args)
     def c.method_missing(_, arg, **args)
       [arg, args]
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([kw, kw], c.m(**{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([kw, kw], c.m(**kw))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h, kw], c.m(**h))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h, kw], c.m(a: 1))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h2, kw], c.m(**h2))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h3, kw], c.m(**h3))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h3, kw], c.m(a: 1, **h2))
     end
 
@@ -2137,11 +2137,11 @@ def c.method_missing(_, args)
       END
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal(kw, c.m(**{}))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal(kw, c.m(**kw))
     end
     assert_equal(h, c.m(**h))
@@ -2161,11 +2161,11 @@ def c.method_missing(_, **args)
     assert_equal(h2, c.m(**h2))
     assert_equal(h3, c.m(**h3))
     assert_equal(h3, c.m(a: 1, **h2))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
       assert_equal(h, c.m(h))
     end
     assert_raise(ArgumentError) { c.m(h2) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
       assert_raise(ArgumentError) { c.m(h3) }
     end
 
@@ -2178,31 +2178,31 @@ def c.method_missing(_, arg, **args)
       END
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([kw, kw], c.m(**{}))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([kw, kw], c.m(**kw))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h, kw], c.m(**h))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h, kw], c.m(a: 1))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h2, kw], c.m(**h2))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h3, kw], c.m(**h3))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h3, kw], c.m(a: 1, **h2))
     end
 
@@ -2252,10 +2252,10 @@ def c.method_missing(_); end
     def c.method_missing(_, args)
       args
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal(kw, c.m(**{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal(kw, c.m(**kw))
     end
     assert_equal(h, c.m(**h))
@@ -2275,11 +2275,11 @@ def c.method_missing(_, **args)
     assert_equal(h2, c.m(**h2))
     assert_equal(h3, c.m(**h3))
     assert_equal(h3, c.m(a: 1, **h2))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
       assert_equal(h, c.m(h))
     end
     assert_raise(ArgumentError) { c.m(h2) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `method_missing'/m) do
       assert_raise(ArgumentError) { c.m(h3) }
     end
 
@@ -2287,25 +2287,25 @@ def c.method_missing(_, **args)
     def c.method_missing(_, arg, **args)
       [arg, args]
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([kw, kw], c.m(**{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([kw, kw], c.m(**kw))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h, kw], c.m(**h))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h, kw], c.m(a: 1))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h2, kw], c.m(**h2))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h3, kw], c.m(**h3))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h3, kw], c.m(a: 1, **h2))
     end
 
@@ -2344,10 +2344,10 @@ class << c
     class << c
       define_method(:m) {|arg| arg }
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal(kw, c.m(**{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal(kw, c.m(**kw))
     end
     assert_equal(h, c.m(**h))
@@ -2379,11 +2379,11 @@ class << c
     assert_equal(h2, c.m(**h2))
     assert_equal(h3, c.m(**h3))
     assert_equal(h3, c.m(a: 1, **h2))
-    assert_warn(/Using the last argument as keyword parameters is deprecated/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated/m) do
       assert_equal(h, c.m(h))
     end
     assert_raise(ArgumentError) { c.m(h2) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated/m) do
       assert_raise(ArgumentError) { c.m(h3) }
     end
 
@@ -2391,25 +2391,25 @@ class << c
     class << c
       define_method(:m) {|arg, **opt| [arg, opt] }
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal([kw, kw], c.m(**{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal([kw, kw], c.m(**kw))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal([h, kw], c.m(**h))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal([h, kw], c.m(a: 1))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal([h2, kw], c.m(**h2))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal([h3, kw], c.m(**h3))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal([h3, kw], c.m(a: 1, **h2))
     end
 
@@ -2429,10 +2429,10 @@ class << c
     class << c
       define_method(:m) {|*args, **opt| [args, opt] }
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal([[], h], c.m(h))
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal([[h], h], c.m(h, h))
     end
 
@@ -2440,10 +2440,10 @@ class << c
     class << c
       define_method(:m) {|arg=nil, a: nil| [arg, a] }
     end
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal([h2, 1], c.m(h3))
     end
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal([h2, 1], c.m(**h3))
     end
   end
@@ -2472,10 +2472,10 @@ class << c
       define_method(:m) {|arg| arg }
     end
     m = c.method(:m)
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal(kw, m.call(**{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal(kw, m.call(**kw))
     end
     assert_equal(h, m.call(**h))
@@ -2509,11 +2509,11 @@ class << c
     assert_equal(h2, m.call(**h2))
     assert_equal(h3, m.call(**h3))
     assert_equal(h3, m.call(a: 1, **h2))
-    assert_warn(/Using the last argument as keyword parameters is deprecated/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated/m) do
       assert_equal(h, m.call(h))
     end
     assert_raise(ArgumentError) { m.call(h2) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated/m) do
       assert_raise(ArgumentError) { m.call(h3) }
     end
 
@@ -2522,25 +2522,25 @@ class << c
       define_method(:m) {|arg, **opt| [arg, opt] }
     end
     m = c.method(:m)
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal([kw, kw], m.call(**{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal([kw, kw], m.call(**kw))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal([h, kw], m.call(**h))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal([h, kw], m.call(a: 1))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal([h2, kw], m.call(**h2))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal([h3, kw], m.call(**h3))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal([h3, kw], m.call(a: 1, **h2))
     end
 
@@ -2562,10 +2562,10 @@ class << c
       define_method(:m) {|*args, **opt| [args, opt] }
     end
     m = c.method(:m)
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal([[], h], m.call(h))
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal([[h], h], m.call(h, h))
     end
 
@@ -2574,10 +2574,10 @@ class << c
       define_method(:m) {|arg=nil, a: nil| [arg, a] }
     end
     m = c.method(:m)
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal([h2, 1], m.call(h3))
     end
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal([h2, 1], m.call(**h3))
     end
   end
@@ -2631,10 +2631,10 @@ def test_attr_writer_kwsplat
     class << c
       attr_writer :m
     end
-    assert_warn(/Passing the keyword argument for `m=' as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument for `m=' as the last hash parameter is deprecated/) do
       c.send(:m=, **{})
     end
-    assert_warn(/Passing the keyword argument for `m=' as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument for `m=' as the last hash parameter is deprecated/) do
       c.send(:m=, **kw)
     end
     assert_equal(h, c.send(:m=, **h))
@@ -2663,10 +2663,10 @@ class << c
       attr_writer :m
     end
     m = c.method(:m=)
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       m.call(**{})
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       m.call(**kw)
     end
     assert_equal(h, m.call(**h))
@@ -2691,17 +2691,17 @@ def test_proc_ruby2_keywords
 
     assert_equal([[1], h1], foo.call(1, :a=>1, &->(*args, **kw){[args, kw]}))
     assert_equal([1, h1], foo.call(1, :a=>1, &->(*args){args}))
-    assert_warn(/Using the last argument as keyword parameters is deprecated/) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated/) do
       assert_equal([[1], h1], foo.call(1, {:a=>1}, &->(*args, **kw){[args, kw]}))
     end
     assert_equal([1, h1], foo.call(1, {:a=>1}, &->(*args){args}))
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h1, {}], foo.call(:a=>1, &->(arg, **kw){[arg, kw]}))
     end
     assert_equal(h1, foo.call(:a=>1, &->(arg){arg}))
 
     [->(){}, ->(arg){}, ->(*args, **kw){}, ->(*args, k: 1){}, ->(*args, k: ){}].each do |pr|
-      assert_warn(/Skipping set of ruby2_keywords flag for proc \(proc accepts keywords or proc does not accept argument splat\)/) do
+      assert_warning(/Skipping set of ruby2_keywords flag for proc \(proc accepts keywords or proc does not accept argument splat\)/) do
         pr.ruby2_keywords
       end
     end
@@ -2711,12 +2711,12 @@ def o.foo(*args)
       yield(*args)
     end
     foo = o.method(:foo).to_proc
-    assert_warn(/Skipping set of ruby2_keywords flag for proc \(proc created from method\)/) do
+    assert_warning(/Skipping set of ruby2_keywords flag for proc \(proc created from method\)/) do
       foo.ruby2_keywords
     end
 
     foo = :foo.to_proc
-    assert_warn(/Skipping set of ruby2_keywords flag for proc \(proc not defined in Ruby\)/) do
+    assert_warning(/Skipping set of ruby2_keywords flag for proc \(proc not defined in Ruby\)/) do
       foo.ruby2_keywords
     end
 
@@ -2907,19 +2907,19 @@ def method_missing(*args)
     assert_equal([[h1], {}], o.foo_foo_bar(h1, **{}))
     assert_equal([h1], o.foo_foo_baz(h1, **{}))
 
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `bar'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `bar'/m) do
       assert_equal([[1], h1], o.foo(:bar, 1, h1))
     end
     assert_equal([1, h1], o.foo(:baz, 1, h1))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `bar'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `bar'/m) do
       assert_equal([[1], h1], o.bfoo(:bar, 1, h1))
     end
     assert_equal([1, h1], o.bfoo(:baz, 1, h1))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `bar'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `bar'/m) do
       assert_equal([[1], h1], o.store_foo(:bar, 1, h1))
     end
     assert_equal([1, h1], o.store_foo(:baz, 1, h1))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `bar'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `bar'/m) do
       assert_equal([[1], h1], o.foo_bar(1, h1))
     end
     assert_equal([1, h1], o.foo_baz(1, h1))
@@ -2971,33 +2971,33 @@ def method_missing(*args)
     assert_equal([[h1], {}], o.foo_dbar(h1, **{}))
     assert_equal([h1], o.foo_dbaz(h1, **{}))
 
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal([[1], h1], o.foo(:dbar, 1, h1))
     end
     assert_equal([1, h1], o.foo(:dbaz, 1, h1))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal([[1], h1], o.bfoo(:dbar, 1, h1))
     end
     assert_equal([1, h1], o.bfoo(:dbaz, 1, h1))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal([[1], h1], o.store_foo(:dbar, 1, h1))
     end
     assert_equal([1, h1], o.store_foo(:dbaz, 1, h1))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal([[1], h1], o.foo_dbar(1, h1))
     end
     assert_equal([1, h1], o.foo_dbaz(1, h1))
 
     assert_equal([[1], h1], o.block(1, :a=>1))
     assert_equal([[1], h1], o.block(1, **h1))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
       assert_equal([[1], h1], o.block(1, h1))
     end
     assert_equal([[h1], {}], o.block(h1, **{}))
 
     assert_equal([[1], h1], o.cfunc(1, :a=>1))
     assert_equal([[1], h1], o.cfunc(1, **h1))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `initialize'/m) do
       assert_equal([[1], h1], o.cfunc(1, h1))
     end
     assert_equal([[h1], {}], o.cfunc(h1, **{}))
@@ -3005,7 +3005,7 @@ def method_missing(*args)
     o = mmkw.new
     assert_equal([[:b, 1], h1], o.b(1, :a=>1))
     assert_equal([[:b, 1], h1], o.b(1, **h1))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
       assert_equal([[:b, 1], h1], o.b(1, h1))
     end
     assert_equal([[:b, h1], {}], o.b(h1, **{}))
@@ -3019,7 +3019,7 @@ def method_missing(*args)
     o = implicit_super.new
     assert_equal([[1], h1], o.bar(1, :a=>1))
     assert_equal([[1], h1], o.bar(1, **h1))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `bar'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `bar'/m) do
       assert_equal([[1], h1], o.bar(1, h1))
     end
     assert_equal([[h1], {}], o.bar(h1, **{}))
@@ -3032,7 +3032,7 @@ def method_missing(*args)
     o = explicit_super.new
     assert_equal([[1], h1], o.bar(1, :a=>1))
     assert_equal([[1], h1], o.bar(1, **h1))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `bar'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `bar'/m) do
       assert_equal([[1], h1], o.bar(1, h1))
     end
     assert_equal([[h1], {}], o.bar(h1, **{}))
@@ -3048,15 +3048,15 @@ def bar(*args, **kw)
         [args, kw]
       end
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `bar'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `bar'/m) do
       assert_equal([[1], h1], o.foo(:pass_bar, 1, :a=>1))
     end
 
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `initialize'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `initialize'/m) do
       assert_equal([[1], h1], o.foo(:pass_cfunc, 1, :a=>1))
     end
 
-    assert_warn(/Skipping set of ruby2_keywords flag for bar \(method accepts keywords or method does not accept argument splat\)/) do
+    assert_warning(/Skipping set of ruby2_keywords flag for bar \(method accepts keywords or method does not accept argument splat\)/) do
       assert_nil(c.send(:ruby2_keywords, :bar))
     end
 
@@ -3064,15 +3064,15 @@ def bar(*args, **kw)
     class << o
       alias bar p
     end
-    assert_warn(/Skipping set of ruby2_keywords flag for bar \(method not defined in Ruby\)/) do
+    assert_warning(/Skipping set of ruby2_keywords flag for bar \(method not defined in Ruby\)/) do
       assert_nil(o.singleton_class.send(:ruby2_keywords, :bar))
     end
     sc = Class.new(c)
-    assert_warn(/Skipping set of ruby2_keywords flag for bar \(can only set in method defining module\)/) do
+    assert_warning(/Skipping set of ruby2_keywords flag for bar \(can only set in method defining module\)/) do
       sc.send(:ruby2_keywords, :bar)
     end
     m = Module.new
-    assert_warn(/Skipping set of ruby2_keywords flag for system \(can only set in method defining module\)/) do
+    assert_warning(/Skipping set of ruby2_keywords flag for system \(can only set in method defining module\)/) do
       m.send(:ruby2_keywords, :system)
     end
 
@@ -3142,23 +3142,23 @@ def c.dig(**args)
     end
     assert_equal(c, [c].dig(0, **{}))
     assert_equal(c, [c].dig(0, **kw))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `dig'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `dig'/m) do
       assert_equal(h, [c].dig(0, **h))
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `dig'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `dig'/m) do
       assert_equal(h, [c].dig(0, a: 1))
     end
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `dig'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `dig'/m) do
       assert_raise(ArgumentError) { [c].dig(0, **h3) }
     end
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `dig'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `dig'/m) do
       assert_raise(ArgumentError) { [c].dig(0, a: 1, **h2) }
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `dig'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `dig'/m) do
       assert_equal(h, [c].dig(0, h))
     end
     assert_raise(ArgumentError) { [c].dig(0, h2) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `dig'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `dig'/m) do
       assert_raise(ArgumentError) { [c].dig(0, h3) }
     end
 
@@ -3180,24 +3180,24 @@ def c.dig(arg=1, **args)
     end
     assert_equal(c, [c].dig(0, **{}))
     assert_equal(c, [c].dig(0, **kw))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `dig'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `dig'/m) do
       assert_equal([1, h], [c].dig(0, **h))
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `dig'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `dig'/m) do
       assert_equal([1, h], [c].dig(0, a: 1))
     end
     assert_equal([h2, kw], [c].dig(0, **h2))
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `dig'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `dig'/m) do
       assert_equal([h2, h], [c].dig(0, **h3))
     end
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `dig'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `dig'/m) do
       assert_equal([h2, h], [c].dig(0, a: 1, **h2))
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `dig'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `dig'/m) do
       assert_equal([1, h], [c].dig(0, h))
     end
     assert_equal([h2, kw], [c].dig(0, h2))
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `dig'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `dig'/m) do
       assert_equal([h2, h], [c].dig(0, h3))
     end
     assert_equal([h, kw], [c].dig(0, h, **{}))
@@ -3252,23 +3252,23 @@ def c.method_missing(_, **args)
     end
     assert_equal(c, [c].dig(0, **{}))
     assert_equal(c, [c].dig(0, **kw))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
       assert_equal(h, [c].dig(0, **h))
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
       assert_equal(h, [c].dig(0, a: 1))
     end
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `method_missing'/m) do
       assert_raise(ArgumentError) { [c].dig(0, **h3) }
     end
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `method_missing'/m) do
       assert_raise(ArgumentError) { [c].dig(0, a: 1, **h2) }
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
       assert_equal(h, [c].dig(0, h))
     end
     assert_raise(ArgumentError) { [c].dig(0, h2) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `method_missing'/m) do
       assert_raise(ArgumentError) { [c].dig(0, h3) }
     end
 
@@ -3290,24 +3290,24 @@ def c.method_missing(_, arg=1, **args)
     end
     assert_equal(c, [c].dig(0, **{}))
     assert_equal(c, [c].dig(0, **kw))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
       assert_equal([1, h], [c].dig(0, **h))
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
       assert_equal([1, h], [c].dig(0, a: 1))
     end
     assert_equal([h2, kw], [c].dig(0, **h2))
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `method_missing'/m) do
       assert_equal([h2, h], [c].dig(0, **h3))
     end
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `method_missing'/m) do
       assert_equal([h2, h], [c].dig(0, a: 1, **h2))
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
       assert_equal([1, h], [c].dig(0, h))
     end
     assert_equal([h2, kw], [c].dig(0, h2))
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `method_missing'/m) do
       assert_equal([h2, h], [c].dig(0, h3))
     end
     assert_equal([h, kw], [c].dig(0, h, **{}))
@@ -3342,10 +3342,10 @@ def test_enumerator_size_kwsplat
     assert_raise(ArgumentError) { c.to_enum(:each, a: 1, **h2, &m).size }
 
     m = ->(args){ args }
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal(kw, c.to_enum(:each, **{}, &m).size)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal(kw, c.to_enum(:each, **kw, &m).size)
     end
     assert_equal(kw, c.to_enum(:each, kw, **kw, &m).size)
@@ -3363,34 +3363,34 @@ def test_enumerator_size_kwsplat
     assert_equal(h2, c.to_enum(:each, **h2, &m).size)
     assert_equal(h3, c.to_enum(:each, **h3, &m).size)
     assert_equal(h3, c.to_enum(:each, a: 1, **h2, &m).size)
-    assert_warn(/Using the last argument as keyword parameters is deprecated/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated/m) do
       assert_equal(h, c.to_enum(:each, h, &m).size)
     end
     assert_raise(ArgumentError) { c.to_enum(:each, h2, &m).size }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated/m) do
       assert_raise(ArgumentError) { c.to_enum(:each, h3, &m).size }
     end
 
     m = ->(arg, **args){ [arg, args] }
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       c.to_enum(:each, **{}, &m).size
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       c.to_enum(:each, **kw, &m).size
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal([h, kw], c.to_enum(:each, **h, &m).size)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal([h, kw], c.to_enum(:each, a: 1, &m).size)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal([h2, kw], c.to_enum(:each, **h2, &m).size)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal([h3, kw], c.to_enum(:each, **h3, &m).size)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
       assert_equal([h3, kw], c.to_enum(:each, a: 1, **h2, &m).size)
     end
     assert_equal([h, kw], c.to_enum(:each, h, &m).size)
@@ -3405,11 +3405,11 @@ def test_enumerator_size_kwsplat
     assert_equal([1, h2], c.to_enum(:each, **h2, &m).size)
     assert_equal([1, h3], c.to_enum(:each, **h3, &m).size)
     assert_equal([1, h3], c.to_enum(:each, a: 1, **h2, &m).size)
-    assert_warn(/Using the last argument as keyword parameters is deprecated/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated/m) do
       assert_equal([1, h], c.to_enum(:each, h, &m).size)
     end
     assert_equal([h2, kw], c.to_enum(:each, h2, &m).size)
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated/m) do
       assert_equal([h2, h], c.to_enum(:each, h3, &m).size)
     end
   end
@@ -3440,10 +3440,10 @@ def test_instance_exec_kwsplat
     assert_raise(ArgumentError) { c.instance_exec(a: 1, **h2, &m) }
 
     m = ->(args) { args }
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal(kw, c.instance_exec(**{}, &m))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal(kw, c.instance_exec(**kw, &m))
     end
     assert_equal(kw, c.instance_exec(kw, **kw, &m))
@@ -3461,34 +3461,34 @@ def test_instance_exec_kwsplat
     assert_equal(h2, c.instance_exec(**h2, &m))
     assert_equal(h3, c.instance_exec(**h3, &m))
     assert_equal(h3, c.instance_exec(a: 1, **h2, &m))
-    assert_warn(/Using the last argument as keyword parameters is deprecated/) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated/) do
       assert_equal(h, c.instance_exec(h, &m))
     end
     assert_raise(ArgumentError) { c.instance_exec(h2, &m) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated/) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated/) do
       assert_raise(ArgumentError) { c.instance_exec(h3, &m) }
     end
 
     m = ->(arg, **args) { [arg, args] }
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       c.instance_exec(**{}, &m)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       c.instance_exec(**kw, &m)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h, kw], c.instance_exec(**h, &m))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h, kw], c.instance_exec(a: 1, &m))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h2, kw], c.instance_exec(**h2, &m))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h3, kw], c.instance_exec(**h3, &m))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h3, kw], c.instance_exec(a: 1, **h2, &m))
     end
     assert_equal([h, kw], c.instance_exec(h, &m))
@@ -3503,11 +3503,11 @@ def test_instance_exec_kwsplat
     assert_equal([1, h2], c.instance_exec(**h2, &m))
     assert_equal([1, h3], c.instance_exec(**h3, &m))
     assert_equal([1, h3], c.instance_exec(a: 1, **h2, &m))
-    assert_warn(/Using the last argument as keyword parameters is deprecated/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated/m) do
       assert_equal([1, h], c.instance_exec(h, &m))
     end
     assert_equal([h2, kw], c.instance_exec(h2, &m))
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated/m) do
       assert_equal([h2, h], c.instance_exec(h3, &m))
     end
   end
@@ -3548,10 +3548,10 @@ def c.m(args)
       args
     end
     m  = c.method(:m)
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal(kw, c.instance_exec(**{}, &m))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal(kw, c.instance_exec(**kw, &m))
     end
     assert_equal(kw, c.instance_exec(kw, **kw, &m))
@@ -3573,11 +3573,11 @@ def c.m(**args)
     assert_equal(h2, c.instance_exec(**h2, &m))
     assert_equal(h3, c.instance_exec(**h3, &m))
     assert_equal(h3, c.instance_exec(a: 1, **h2, &m))
-    assert_warn(/Using the last argument as keyword parameters is deprecated/) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated/) do
       assert_equal(h, c.instance_exec(h, &m))
     end
     assert_raise(ArgumentError) { c.instance_exec(h2, &m) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated/) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated/) do
       assert_raise(ArgumentError) { c.instance_exec(h3, &m) }
     end
 
@@ -3586,25 +3586,25 @@ def c.m(arg, **args)
       [arg, args]
     end
     m  = c.method(:m)
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       c.instance_exec(**{}, &m)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       c.instance_exec(**kw, &m)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h, kw], c.instance_exec(**h, &m))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h, kw], c.instance_exec(a: 1, &m))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h2, kw], c.instance_exec(**h2, &m))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h3, kw], c.instance_exec(**h3, &m))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h3, kw], c.instance_exec(a: 1, **h2, &m))
     end
     assert_equal([h, kw], c.instance_exec(h, &m))
@@ -3623,11 +3623,11 @@ def c.m(arg=1, **args)
     assert_equal([1, h2], c.instance_exec(**h2, &m))
     assert_equal([1, h3], c.instance_exec(**h3, &m))
     assert_equal([1, h3], c.instance_exec(a: 1, **h2, &m))
-    assert_warn(/Using the last argument as keyword parameters is deprecated/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated/m) do
       assert_equal([1, h], c.instance_exec(h, &m))
     end
     assert_equal([h2, kw], c.instance_exec(h2, &m))
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated/) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated/) do
       assert_equal([h2, h], c.instance_exec(h3, &m))
     end
   end
@@ -3668,10 +3668,10 @@ def test_instance_exec_define_method_kwsplat
       args
     end
     m  = c.method(:m)
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal(kw, c.instance_exec(**{}, &m))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal(kw, c.instance_exec(**kw, &m))
     end
     assert_equal(kw, c.instance_exec(kw, **kw, &m))
@@ -3693,11 +3693,11 @@ def test_instance_exec_define_method_kwsplat
     assert_equal(h2, c.instance_exec(**h2, &m))
     assert_equal(h3, c.instance_exec(**h3, &m))
     assert_equal(h3, c.instance_exec(a: 1, **h2, &m))
-    assert_warn(/Using the last argument as keyword parameters is deprecated/) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated/) do
       assert_equal(h, c.instance_exec(h, &m))
     end
     assert_raise(ArgumentError) { c.instance_exec(h2, &m) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated/) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated/) do
       assert_raise(ArgumentError) { c.instance_exec(h3, &m) }
     end
 
@@ -3706,25 +3706,25 @@ def test_instance_exec_define_method_kwsplat
       [arg, args]
     end
     m  = c.method(:m)
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       c.instance_exec(**{}, &m)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       c.instance_exec(**kw, &m)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h, kw], c.instance_exec(**h, &m))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h, kw], c.instance_exec(a: 1, &m))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h2, kw], c.instance_exec(**h2, &m))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h3, kw], c.instance_exec(**h3, &m))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h3, kw], c.instance_exec(a: 1, **h2, &m))
     end
     assert_equal([h, kw], c.instance_exec(h, &m))
@@ -3743,11 +3743,11 @@ def test_instance_exec_define_method_kwsplat
     assert_equal([1, h2], c.instance_exec(**h2, &m))
     assert_equal([1, h3], c.instance_exec(**h3, &m))
     assert_equal([1, h3], c.instance_exec(a: 1, **h2, &m))
-    assert_warn(/Using the last argument as keyword parameters is deprecated/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated/m) do
       assert_equal([1, h], c.instance_exec(h, &m))
     end
     assert_equal([h2, kw], c.instance_exec(h2, &m))
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated/) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated/) do
       assert_equal([h2, h], c.instance_exec(h3, &m))
     end
   end
@@ -3785,10 +3785,10 @@ def c.m
     def c.m(args)
       args
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal(kw, c.instance_exec(c, **{}, &:m))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal(kw, c.instance_exec(c, **kw, &:m))
     end
     assert_equal(kw, c.instance_exec(c, kw, **kw, &:m))
@@ -3809,11 +3809,11 @@ def c.m(**args)
     assert_equal(h2, c.instance_exec(c, **h2, &:m))
     assert_equal(h3, c.instance_exec(c, **h3, &:m))
     assert_equal(h3, c.instance_exec(c, a: 1, **h2, &:m))
-    assert_warn(/Using the last argument as keyword parameters is deprecated/) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated/) do
       assert_equal(h, c.instance_exec(c, h, &:m))
     end
     assert_raise(ArgumentError) { c.instance_exec(c, h2, &:m) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated/) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated/) do
       assert_raise(ArgumentError) { c.instance_exec(c, h3, &:m) }
     end
 
@@ -3821,25 +3821,25 @@ def c.m(**args)
     def c.m(arg, **args)
       [arg, args]
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       c.instance_exec(c, **{}, &:m)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       c.instance_exec(c, **kw, &:m)
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h, kw], c.instance_exec(c, **h, &:m))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h, kw], c.instance_exec(c, a: 1, &:m))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h2, kw], c.instance_exec(c, **h2, &:m))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h3, kw], c.instance_exec(c, **h3, &:m))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
       assert_equal([h3, kw], c.instance_exec(c, a: 1, **h2, &:m))
     end
     assert_equal([h, kw], c.instance_exec(c, h, &:m))
@@ -3857,11 +3857,11 @@ def c.m(arg=1, **args)
     assert_equal([1, h2], c.instance_exec(c, **h2, &:m))
     assert_equal([1, h3], c.instance_exec(c, **h3, &:m))
     assert_equal([1, h3], c.instance_exec(c, a: 1, **h2, &:m))
-    assert_warn(/Using the last argument as keyword parameters is deprecated/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated/m) do
       assert_equal([1, h], c.instance_exec(c, h, &:m))
     end
     assert_equal([h2, kw], c.instance_exec(c, h2, &:m))
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated/) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated/) do
       assert_equal([h2, h], c.instance_exec(c, h3, &:m))
     end
   end
@@ -3902,10 +3902,10 @@ def c.c; end
     def c.c(args)
       args
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `c'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `c'/m) do
       assert_equal(kw, c.m(:c, **{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `c'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `c'/m) do
       assert_equal(kw, c.m(:c, **kw))
     end
     assert_equal(kw, c.m(:c, kw, **kw))
@@ -3927,11 +3927,11 @@ def c.c(**args)
     assert_equal([h2, h2], c.m(:c, **h2, &m))
     assert_equal([h3, h3], c.m(:c, **h3, &m))
     assert_equal([h3, h3], c.m(:c, a: 1, **h2, &m))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `c'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `c'/m) do
       assert_equal([h, h], c.m(:c, h, &m))
     end
     assert_raise(ArgumentError) { c.m(:c, h2, &m) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `c'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `c'/m) do
       assert_raise(ArgumentError) { c.m(:c, h3, &m) }
     end
 
@@ -3939,25 +3939,25 @@ def c.c(**args)
     def c.c(arg, **args)
       [arg, args]
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `c'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `c'/m) do
       assert_equal([kw, kw], c.m(:c, **{}))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `c'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `c'/m) do
       assert_equal([kw, kw], c.m(:c, **kw))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `c'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `c'/m) do
       assert_equal([h, kw], c.m(:c, **h))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `c'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `c'/m) do
       assert_equal([h, kw], c.m(:c, a: 1))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `c'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `c'/m) do
       assert_equal([h2, kw], c.m(:c, **h2))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `c'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `c'/m) do
       assert_equal([h3, kw], c.m(:c, **h3))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `c'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `c'/m) do
       assert_equal([h3, kw], c.m(:c, a: 1, **h2))
     end
     assert_equal([h, kw], c.m(:c, h))
@@ -3975,11 +3975,11 @@ def c.c(arg=1, **args)
     assert_equal([1, h2], c.m(:c, **h2))
     assert_equal([1, h3], c.m(:c, **h3))
     assert_equal([1, h3], c.m(:c, a: 1, **h2))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `c'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `c'/m) do
       assert_equal([1, h], c.m(:c, h))
     end
     assert_equal([h2, kw], c.m(:c, h2))
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `c'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `c'/m) do
       assert_equal([h2, h], c.m(:c, h3))
     end
   end
@@ -4110,22 +4110,22 @@ def test_rest_keyrest
     bug7665 = '[ruby-core:51278]'
     bug8463 = '[ruby-core:55203] [Bug #8463]'
     expect = [*%w[foo bar], {zzz: 42}]
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `rest_keyrest'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `rest_keyrest'/m) do
       assert_equal(expect, rest_keyrest(*expect), bug7665)
     end
     pr = proc {|*args, **opt| next *args, opt}
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
       assert_equal(expect, pr.call(*expect), bug7665)
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
       assert_equal(expect, pr.call(expect), bug8463)
     end
     pr = proc {|a, *b, **opt| next a, *b, opt}
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
       assert_equal(expect, pr.call(expect), bug8463)
     end
     pr = proc {|a, **opt| next a, opt}
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
       assert_equal(expect.values_at(0, -1), pr.call(expect), bug8463)
     end
   end
@@ -4143,13 +4143,13 @@ def splat_plus_keyword(*a, **h)
   end
 
   def test_keyword_split
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `req_plus_keyword'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `req_plus_keyword'/m) do
       assert_equal([{:a=>1}, {}], req_plus_keyword(:a=>1))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `req_plus_keyword'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `req_plus_keyword'/m) do
       assert_equal([{"a"=>1}, {}], req_plus_keyword("a"=>1))
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `req_plus_keyword'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `req_plus_keyword'/m) do
       assert_equal([{"a"=>1, :a=>1}, {}], req_plus_keyword("a"=>1, :a=>1))
     end
     assert_equal([{:a=>1}, {}], req_plus_keyword({:a=>1}))
@@ -4159,22 +4159,22 @@ def test_keyword_split
     assert_equal([1, {:a=>1}], opt_plus_keyword(:a=>1))
     assert_equal([1, {"a"=>1}], opt_plus_keyword("a"=>1))
     assert_equal([1, {"a"=>1, :a=>1}], opt_plus_keyword("a"=>1, :a=>1))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `opt_plus_keyword'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `opt_plus_keyword'/m) do
       assert_equal([1, {:a=>1}], opt_plus_keyword({:a=>1}))
     end
     assert_equal([{"a"=>1}, {}], opt_plus_keyword({"a"=>1}))
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `opt_plus_keyword'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `opt_plus_keyword'/m) do
       assert_equal([{"a"=>1}, {:a=>1}], opt_plus_keyword({"a"=>1, :a=>1}))
     end
 
     assert_equal([[], {:a=>1}], splat_plus_keyword(:a=>1))
     assert_equal([[], {"a"=>1}], splat_plus_keyword("a"=>1))
     assert_equal([[], {"a"=>1, :a=>1}], splat_plus_keyword("a"=>1, :a=>1))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `splat_plus_keyword'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `splat_plus_keyword'/m) do
       assert_equal([[], {:a=>1}], splat_plus_keyword({:a=>1}))
     end
     assert_equal([[{"a"=>1}], {}], splat_plus_keyword({"a"=>1}))
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `splat_plus_keyword'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `splat_plus_keyword'/m) do
       assert_equal([[{"a"=>1}], {:a=>1}], splat_plus_keyword({"a"=>1, :a=>1}))
     end
   end
@@ -4361,7 +4361,7 @@ def foo(a, b, c=1, *d, e, f:2, **g)
         [a, b, c, d, e, f, g]
       end
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `foo'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `foo'/m) do
       assert_equal([1, 2, 1, [], {:f=>5}, 2, {}], a.new.foo(1, 2, f:5), bug8993)
     end
   end
@@ -4396,10 +4396,10 @@ def test_implicit_hash_conversion
     o = Object.new
     def o.to_hash() { k: 9 } end
     assert_equal([1, 42, [], o, :key, {}, nil], f9(1, o))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m1'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m1'/m) do
       assert_equal([1, 9], m1(1, o) {|a, k: 0| break [a, k]}, bug10016)
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m1'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m1'/m) do
       assert_equal([1, 9], m1(1, o, &->(a, k: 0) {break [a, k]}), bug10016)
     end
   end
@@ -4714,11 +4714,11 @@ def c.m(args)
       END
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, c.call(**{}, &:m))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal(kw, c.call(**kw, &:m))
     end
     assert_equal(h, c.call(**h, &:m))
@@ -4738,11 +4738,11 @@ def c.m(**args)
     assert_equal(h2, c.call(**h2, &:m))
     assert_equal(h3, c.call(**h3, &:m))
     assert_equal(h3, c.call(a: 1, **h2, &:m))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
       assert_equal(h, c.call(h, &:m))
     end
     assert_raise(ArgumentError) { c.call(h2, &:m) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `call'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `call'/m) do
       assert_raise(ArgumentError) { c.call(h3, &:m) }
     end
 
@@ -4755,31 +4755,31 @@ def c.m(arg, **args)
       END
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([kw, kw], c.call(**{}, &:m))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([kw, kw], c.call(**kw, &:m))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], c.call(**h, &:m))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h, kw], c.call(a: 1, &:m))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h2, kw], c.call(**h2, &:m))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], c.call(**h3, &:m))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
       assert_equal([h3, kw], c.call(a: 1, **h2, &:m))
     end
 
@@ -4834,11 +4834,11 @@ def c.method_missing(_, args)
       END
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal(kw, c.call(**{}, &:m))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal(kw, c.call(**kw, &:m))
     end
     assert_equal(h, c.call(**h, &:m))
@@ -4858,11 +4858,11 @@ def c.method_missing(_, **args)
     assert_equal(h2, c.call(**h2, &:m))
     assert_equal(h3, c.call(**h3, &:m))
     assert_equal(h3, c.call(a: 1, **h2, &:m))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
       assert_equal(h, c.call(h, &:m2))
     end
     assert_raise(ArgumentError) { c.call(h2, &:m2) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `call'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `call'/m) do
       assert_raise(ArgumentError) { c.call(h3, &:m2) }
     end
 
@@ -4875,31 +4875,31 @@ def c.method_missing(_, arg, **args)
       END
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([kw, kw], c.call(**{}, &:m))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([kw, kw], c.call(**kw, &:m))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h, kw], c.call(**h, &:m))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h, kw], c.call(a: 1, &:m))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h2, kw], c.call(**h2, &:m))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h3, kw], c.call(**h3, &:m))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h3, kw], c.call(a: 1, **h2, &:m))
     end
 
@@ -4954,11 +4954,11 @@ def c.method_missing(_, args)
       END
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal(kw, c.call(**{}, &:m2))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal(kw, c.call(**kw, &:m2))
     end
     assert_equal(h, c.call(**h, &:m2))
@@ -4978,11 +4978,11 @@ def c.method_missing(_, **args)
     assert_equal(h2, c.call(**h2, &:m2))
     assert_equal(h3, c.call(**h3, &:m2))
     assert_equal(h3, c.call(a: 1, **h2, &:m2))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
       assert_equal(h, c.call(h, &:m2))
     end
     assert_raise(ArgumentError) { c.call(h2, &:m2) }
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `call'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `call'/m) do
       assert_raise(ArgumentError) { c.call(h3, &:m2) }
     end
 
@@ -4995,31 +4995,31 @@ def c.method_missing(_, arg, **args)
       END
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([kw, kw], c.call(**{}, &:m2))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([kw, kw], c.call(**kw, &:m2))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h, kw], c.call(**h, &:m2))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h, kw], c.call(a: 1, &:m2))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h2, kw], c.call(**h2, &:m2))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h3, kw], c.call(**h3, &:m2))
     end
     redef[]
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
       assert_equal([h3, kw], c.call(a: 1, **h2, &:m2))
     end
 
diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb
index 3f0d599a04..672738d0b4 100644
--- a/test/ruby/test_proc.rb
+++ b/test/ruby/test_proc.rb
@@ -1505,27 +1505,27 @@ def test_compose_keywords
     g = ->(kw) { kw.merge(:a=>2) }
 
     assert_equal(2, (f >> g).call(a: 3)[:a])
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(1, (f << g).call(a: 3)[:a])
     end
     assert_equal(2, (f >> g).call(a: 3)[:a])
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(1, (f << g).call({a: 3})[:a])
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(2, (f >> g).call({a: 3})[:a])
     end
     assert_equal(2, (g << f).call(a: 3)[:a])
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(1, (g >> f).call(a: 3)[:a])
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(2, (g << f).call({a: 3})[:a])
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(1, (g >> f).call({a: 3})[:a])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(1, (f << g).call(**{})[:a])
     end
     assert_equal(2, (f >> g).call(**{})[:a])
@@ -1535,27 +1535,27 @@ def test_compose_keywords_method
     f = ->(**kw) { kw.merge(:a=>1) }.method(:call)
     g = ->(kw) { kw.merge(:a=>2) }.method(:call)
 
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(1, (f << g).call(a: 3)[:a])
     end
     assert_equal(2, (f >> g).call(a: 3)[:a])
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(1, (f << g).call({a: 3})[:a])
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(2, (f >> g).call({a: 3})[:a])
     end
     assert_equal(2, (g << f).call(a: 3)[:a])
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(1, (g >> f).call(a: 3)[:a])
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(2, (g << f).call({a: 3})[:a])
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(1, (g >> f).call({a: 3})[:a])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(1, (f << g).call(**{})[:a])
     end
     assert_equal(2, (f >> g).call(**{})[:a])
@@ -1569,27 +1569,27 @@ def g.to_proc; method(:call).to_proc; end
     def g.<<(f) to_proc << f end
     def g.>>(f) to_proc >> f end
 
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(1, (f << g).call(a: 3)[:a])
     end
     assert_equal(2, (f >> g).call(a: 3)[:a])
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(1, (f << g).call({a: 3})[:a])
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(2, (f >> g).call({a: 3})[:a])
     end
     assert_equal(2, (g << f).call(a: 3)[:a])
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(1, (g >> f).call(a: 3)[:a])
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(2, (g << f).call({a: 3})[:a])
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
       assert_equal(1, (g >> f).call({a: 3})[:a])
     end
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `call'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `call'/m) do
       assert_equal(1, (f << g).call(**{})[:a])
     end
     assert_equal(2, (f >> g).call(**{})[:a])
@@ -1602,27 +1602,27 @@ def g.<<(f) to_proc << f end
     def g.>>(f) to_proc >> f end
 
     assert_equal(1, (f << g).call(a: 3)[:a])
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
       assert_equal(2, (f >> g).call(a: 3)[:a])
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
       assert_equal(1, (f << g).call({a: 3})[:a])
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
       assert_equal(2, (f >> g).call({a: 3})[:a])
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
       assert_equal(2, (g << f).call(a: 3)[:a])
     end
     assert_equal(1, (g >> f).call(a: 3)[:a])
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
       assert_equal(2, (g << f).call({a: 3})[:a])
     end
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
       assert_equal(1, (g >> f).call({a: 3})[:a])
     end
     assert_equal(1, (f << g).call(**{})[:a])
-    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
+    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*Using the last argument as keyword parameters is deprecated.*The called method `call'/m) do
       assert_equal(2, (f >> g).call(**{})[:a])
     end
   end
diff --git a/test/ruby/test_struct.rb b/test/ruby/test_struct.rb
index f13afbbdd4..81437a9339 100644
--- a/test/ruby/test_struct.rb
+++ b/test/ruby/test_struct.rb
@@ -115,9 +115,9 @@ def test_struct_new_with_keyword_init
     assert_equal "#{@Struct}::KeywordInitTrue(keyword_init: true)", @Struct::KeywordInitTrue.inspect
     # eval is needed to prevent the warning duplication filter
     k = eval("Class.new(@Struct::KeywordInitFalse) {def initialize(**) end}")
-    assert_warn(/Using the last argument as keyword parameters is deprecated/) {k.new(a: 1, b: 2)}
+    assert_warning(/Using the last argument as keyword parameters is deprecated/) {k.new(a: 1, b: 2)}
     k = Class.new(@Struct::KeywordInitTrue) {def initialize(**) end}
-    assert_warn('') {k.new(a: 1, b: 2)}
+    assert_warning('') {k.new(a: 1, b: 2)}
 
     @Struct.instance_eval do
       remove_const(:KeywordInitTrue)
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 21b0bc7ce7..65475ff2ff 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -182,7 +182,7 @@ def test_keyword_duplicated_splat
     h = {k3: 31}
     assert_raise(ArgumentError) {o.kw(**h)}
     h = {"k1"=>11, k2: 12}
-    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `kw'/m) do
+    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `kw'/m) do
       assert_raise(ArgumentError) {o.kw(**h)}
     end
   end
diff --git a/test/test_delegate.rb b/test/test_delegate.rb
index 426a647808..09769001eb 100644
--- a/test/test_delegate.rb
+++ b/test/test_delegate.rb
@@ -190,7 +190,7 @@ def foo.foo(*args, **kw)
     assert_equal([], d.bar)
     assert_equal([[], {:a=>1}], d.foo(:a=>1))
     assert_equal([{:a=>1}], d.bar(:a=>1))
-    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `foo'/m) do
+    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `foo'/m) do
       assert_equal([[], {:a=>1}], d.foo({:a=>1}))
     end
     assert_equal([{:a=>1}], d.bar({:a=>1}))
diff --git a/vm_args.c b/vm_args.c
index cf0328d4b7..abac745f16 100644
--- a/vm_args.c
+++ b/vm_args.c
@@ -597,7 +597,7 @@ static st_table *caller_to_callees = 0;
 static VALUE
 rb_warn_check(const rb_execution_context_t * const ec, const rb_iseq_t *const iseq)
 {
-    if (!rb_warning_category_enabled_p(RB_WARN_CATEGORY_DEPRECATED)) return 1;
+    if (!rb_warning_category_enabled_p(RB_WARN_CATEGORY_DEPRECATED) || !ruby_verbose) return 1;
 
     if (!iseq) return 0;
 
-- 
2.27.0

