Project

General

Profile

Feature #17000 ยป keyword-warnings-verbose-mode.patch

jeremyevans0 (Jeremy Evans), 07/04/2020 05:04 PM

View differences:

test/-ext-/funcall/test_passing_block.rb
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
......
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
......
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
test/ruby/test_io.rb
match
end
assert_warn(w) do
assert_warning(w) do
assert_equal({:a=>1}, open(o, {a: 1}))
end
test/ruby/test_keyword.rb
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
......
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))
......
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
......
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))
......
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
......
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))
......
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
......
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
......
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))
......
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
......
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
......
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])
......
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
......
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])
......
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
......
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)
......
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
......
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))
......
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
......
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))
......
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
......
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))
......
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
......
@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)
......
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
......
@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
......
@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)
......
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
......
@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
......
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])
......
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
......
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
......
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))
......
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
......
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
......
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))
......
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
......
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
......
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))
......
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
......
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
......
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))
......
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
......
[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
......
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))
......
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
......
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
......
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))
......
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
......
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
......
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))
......
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
......
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
......
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))
......
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
......
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
......
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))
......
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
......
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
......
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))
......
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
......
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
......
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
......
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
......
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))
......
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
......
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
... This diff was truncated because it exceeds the maximum size that can be displayed.
    (1-1/1)