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
29 29
    assert_equal([[{}], {}], Relay.with_funcall_passing_block_kw(2, {}, **{}, &block))
30 30
    assert_equal([[], {a: 1}], Relay.with_funcall_passing_block_kw(3, a: 1, &block))
31 31
    assert_equal([[{a: 1}], {}], Relay.with_funcall_passing_block_kw(3, {a: 1}, **{}, &block))
32
    assert_warn(/warning: Passing the keyword argument as the last hash parameter is deprecated.*The called method is defined here/m) do
32
    assert_warning(/warning: Passing the keyword argument as the last hash parameter is deprecated.*The called method is defined here/m) do
33 33
      assert_equal({}, Relay.with_funcall_passing_block_kw(3, **{}, &->(a){a}))
34 34
    end
35 35
  end
......
53 53
    assert_equal([[], {a: 1}], Relay.with_funcallv_public_kw(o, :foo, 3, a: 1))
54 54
    assert_equal([[{a: 1}], {}], Relay.with_funcallv_public_kw(o, :foo, 3, {a: 1}, **{}))
55 55
    assert_raise(NoMethodError) { Relay.with_funcallv_public_kw(o, :bar, 3, {a: 1}, **{}) }
56
    assert_warn(/warning: Passing the keyword argument as the last hash parameter is deprecated.*The called method `baz'/m) do
56
    assert_warning(/warning: Passing the keyword argument as the last hash parameter is deprecated.*The called method `baz'/m) do
57 57
      assert_equal({}, Relay.with_funcallv_public_kw(o, :baz, 3, **{}))
58 58
    end
59 59
  end
......
64 64
    assert_equal([[], {a: 1}], Relay.with_yield_splat_kw(1, [{a: 1}], &block))
65 65
    assert_equal([[1], {a: 1}], Relay.with_yield_splat_kw(1, [1, {a: 1}], &block))
66 66
    assert_equal([[{}], {}], Relay.with_yield_splat_kw(2, [{}], **{}, &block))
67
    assert_warn(/warning: Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
67
    assert_warning(/warning: Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
68 68
      assert_equal([[], {a: 1}], Relay.with_yield_splat_kw(3, [{a: 1}], &block))
69 69
    end
70 70
    assert_equal([[{a: 1}], {}], Relay.with_yield_splat_kw(3, [{a: 1}], **{}, &block))
71
    assert_warn(/warning: Passing the keyword argument as the last hash parameter is deprecated/) do
71
    assert_warning(/warning: Passing the keyword argument as the last hash parameter is deprecated/) do
72 72
      assert_equal({}, Relay.with_yield_splat_kw(3, [], **{}, &->(a){a}))
73 73
    end
74 74
  end
test/ruby/test_io.rb
2292 2292
      match
2293 2293
    end
2294 2294

  
2295
    assert_warn(w) do
2295
    assert_warning(w) do
2296 2296
      assert_equal({:a=>1}, open(o, {a: 1}))
2297 2297
    end
2298 2298

  
test/ruby/test_keyword.rb
24 24

  
25 25
  def test_f2
26 26
    assert_equal([:xyz, "foo", 424242], f2(:xyz))
27
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `f2'/m) do
27
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `f2'/m) do
28 28
      assert_equal([{"bar"=>42}, "foo", 424242], f2("bar"=>42))
29 29
    end
30 30
  end
......
224 224
    def c.m(args)
225 225
      args
226 226
    end
227
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
227
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
228 228
      assert_equal(kw, c.m(**{}))
229 229
    end
230
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
230
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
231 231
      assert_equal(kw, c.m(**kw))
232 232
    end
233 233
    assert_equal(kw, c.m(kw, **kw))
......
248 248
    assert_equal(h2, c.m(**h2))
249 249
    assert_equal(h3, c.m(**h3))
250 250
    assert_equal(h3, c.m(a: 1, **h2))
251
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
251
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
252 252
      assert_equal(h, c.m(h))
253 253
    end
254 254
    assert_raise(ArgumentError) { c.m(h2) }
255
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
255
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
256 256
      assert_raise(ArgumentError) { c.m(h3) }
257 257
    end
258 258

  
......
260 260
    def c.m(arg, **args)
261 261
      [arg, args]
262 262
    end
263
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
263
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
264 264
      c.m(**{})
265 265
    end
266
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
266
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
267 267
      c.m(**kw)
268 268
    end
269
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
269
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
270 270
      assert_equal([h, kw], c.m(**h))
271 271
    end
272
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
272
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
273 273
      assert_equal([h, kw], c.m(a: 1))
274 274
    end
275
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
275
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
276 276
      assert_equal([h2, kw], c.m(**h2))
277 277
    end
278
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
278
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
279 279
      assert_equal([h3, kw], c.m(**h3))
280 280
    end
281
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
281
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
282 282
      assert_equal([h3, kw], c.m(a: 1, **h2))
283 283
    end
284 284
    assert_equal([h, kw], c.m(h))
......
296 296
    assert_equal([1, h2], c.m(**h2))
297 297
    assert_equal([1, h3], c.m(**h3))
298 298
    assert_equal([1, h3], c.m(a: 1, **h2))
299
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
299
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
300 300
      assert_equal([1, h], c.m(h))
301 301
    end
302 302
    assert_equal([h2, kw], c.m(h2))
303
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
303
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
304 304
      assert_equal([h2, h], c.m(h3))
305 305
    end
306 306
  end
......
357 357
        args
358 358
      end
359 359
    end
360
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
360
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
361 361
      assert_equal(kw, c.m(**{}))
362 362
    end
363 363
    redef[]
364
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
364
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
365 365
      assert_equal(kw, c.m(**kw))
366 366
    end
367 367
    assert_equal(h, c.m(**h))
......
383 383
    assert_equal(h2, c.m(**h2))
384 384
    assert_equal(h3, c.m(**h3))
385 385
    assert_equal(h3, c.m(a: 1, **h2))
386
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
386
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
387 387
      assert_equal(h, c.m(h))
388 388
    end
389 389
    assert_raise(ArgumentError) { c.m(h2) }
390
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
390
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
391 391
      assert_raise(ArgumentError) { c.m(h3) }
392 392
    end
393 393

  
......
398 398
      end
399 399
    end
400 400
    redef[]
401
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
401
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
402 402
      c.m(**{})
403 403
    end
404 404
    redef[]
405
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
405
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
406 406
      c.m(**kw)
407 407
    end
408 408
    redef[]
409
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
409
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
410 410
      assert_equal([h, kw], c.m(**h))
411 411
    end
412 412
    redef[]
413
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
413
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
414 414
      assert_equal([h, kw], c.m(a: 1))
415 415
    end
416 416
    redef[]
417
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
417
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
418 418
      assert_equal([h2, kw], c.m(**h2))
419 419
    end
420 420
    redef[]
421
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
421
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
422 422
      assert_equal([h3, kw], c.m(**h3))
423 423
    end
424 424
    redef[]
425
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
425
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
426 426
      assert_equal([h3, kw], c.m(a: 1, **h2))
427 427
    end
428 428

  
......
493 493
        args
494 494
      end
495 495
    end
496
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
496
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
497 497
      assert_equal(kw, c.m(**{}))
498 498
    end
499 499
    redef[]
500
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
500
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
501 501
      assert_equal(kw, c.m(**kw))
502 502
    end
503 503
    assert_equal(h, c.m(**h))
......
519 519
    assert_equal(h2, c.m(**h2))
520 520
    assert_equal(h3, c.m(**h3))
521 521
    assert_equal(h3, c.m(a: 1, **h2))
522
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
522
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
523 523
      assert_equal(h, c.m(h))
524 524
    end
525 525
    assert_raise(ArgumentError) { c.m(h2) }
526
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
526
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
527 527
      assert_raise(ArgumentError) { c.m(h3) }
528 528
    end
529 529

  
......
534 534
      end
535 535
    end
536 536
    redef[]
537
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
537
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
538 538
      c.m(**{})
539 539
    end
540 540
    redef[]
541
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
541
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
542 542
      c.m(**kw)
543 543
    end
544 544
    redef[]
545
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
545
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
546 546
      assert_equal([h, kw], c.m(**h))
547 547
    end
548 548
    redef[]
549
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
549
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
550 550
      assert_equal([h, kw], c.m(a: 1))
551 551
    end
552 552
    redef[]
553
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
553
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
554 554
      assert_equal([h2, kw], c.m(**h2))
555 555
    end
556 556
    redef[]
557
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
557
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
558 558
      assert_equal([h3, kw], c.m(**h3))
559 559
    end
560 560
    redef[]
561
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
561
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
562 562
      assert_equal([h3, kw], c.m(a: 1, **h2))
563 563
    end
564 564

  
......
592 592
    assert_raise(ArgumentError) { f[**h3] }
593 593

  
594 594
    f = ->(a) { a }
595
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
595
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
596 596
      assert_equal(kw, f[**{}])
597 597
    end
598
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
598
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
599 599
      assert_equal(kw, f[**kw])
600 600
    end
601 601
    assert_equal(h, f[**h])
......
612 612
    assert_equal(h2, f[**h2])
613 613
    assert_equal(h3, f[**h3])
614 614
    assert_equal(h3, f[a: 1, **h2])
615
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `\[\]'/m) do
615
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `\[\]'/m) do
616 616
      assert_equal(h, f[h])
617 617
    end
618 618
    assert_raise(ArgumentError) { f[h2] }
619
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `\[\]'/m) do
619
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `\[\]'/m) do
620 620
      assert_raise(ArgumentError) { f[h3] }
621 621
    end
622 622

  
623 623
    f = ->(a, **x) { [a,x] }
624
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
624
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
625 625
      assert_equal([{}, {}], f[**{}])
626 626
    end
627
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
627
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
628 628
      assert_equal([{}, {}], f[**kw])
629 629
    end
630
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
630
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
631 631
      assert_equal([h, {}], f[**h])
632 632
    end
633
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
633
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
634 634
      assert_equal([h, {}], f[a: 1])
635 635
    end
636
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
636
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
637 637
      assert_equal([h2, {}], f[**h2])
638 638
    end
639
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
639
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
640 640
      assert_equal([h3, {}], f[**h3])
641 641
    end
642
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
642
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `\[\]'/m) do
643 643
      assert_equal([h3, {}], f[a: 1, **h2])
644 644
    end
645 645

  
......
670 670

  
671 671
    f = ->(a) { a }
672 672
    f = f.method(:call)
673
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
673
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
674 674
      assert_equal(kw, f[**{}])
675 675
    end
676
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
676
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
677 677
      assert_equal(kw, f[**kw])
678 678
    end
679 679
    assert_equal(h, f[**h])
......
691 691
    assert_equal(h2, f[**h2])
692 692
    assert_equal(h3, f[**h3])
693 693
    assert_equal(h3, f[a: 1, **h2])
694
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
694
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
695 695
      assert_equal(h, f[h])
696 696
    end
697 697
    assert_raise(ArgumentError) { f[h2] }
698
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
698
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
699 699
      assert_raise(ArgumentError) { f[h3] }
700 700
    end
701 701

  
702 702
    f = ->(a, **x) { [a,x] }
703 703
    f = f.method(:call)
704
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
704
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
705 705
      assert_equal([{}, {}], f[**{}])
706 706
    end
707
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
707
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
708 708
      assert_equal([{}, {}], f[**kw])
709 709
    end
710
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
710
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
711 711
      assert_equal([h, {}], f[**h])
712 712
    end
713
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
713
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
714 714
      assert_equal([h, {}], f[a: 1])
715 715
    end
716
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
716
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
717 717
      assert_equal([h2, {}], f[**h2])
718 718
    end
719
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
719
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
720 720
      assert_equal([h3, {}], f[**h3])
721 721
    end
722
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
722
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
723 723
      assert_equal([h3, {}], f[a: 1, **h2])
724 724
    end
725 725

  
......
751 751
    assert_raise(ArgumentError) { t.new(**h3, &f).value }
752 752

  
753 753
    f = ->(a) { a }
754
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
754
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
755 755
      assert_equal(kw, t.new(**{}, &f).value)
756 756
    end
757
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
757
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
758 758
      assert_equal(kw, t.new(**kw, &f).value)
759 759
    end
760 760
    assert_equal(h, t.new(**h, &f).value)
......
771 771
    assert_equal(h2, t.new(**h2, &f).value)
772 772
    assert_equal(h3, t.new(**h3, &f).value)
773 773
    assert_equal(h3, t.new(a: 1, **h2, &f).value)
774
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
774
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
775 775
      assert_equal(h, t.new(h, &f).value)
776 776
    end
777 777
    assert_raise(ArgumentError) { t.new(h2, &f).value }
778
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
778
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
779 779
      assert_raise(ArgumentError) { t.new(h3, &f).value }
780 780
    end
781 781

  
782 782
    f = ->(a, **x) { [a,x] }
783
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
783
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
784 784
      assert_equal([{}, {}], t.new(**{}, &f).value)
785 785
    end
786
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
786
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
787 787
      assert_equal([{}, {}], t.new(**kw, &f).value)
788 788
    end
789
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
789
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
790 790
      assert_equal([h, {}], t.new(**h, &f).value)
791 791
    end
792
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
792
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
793 793
      assert_equal([h, {}], t.new(a: 1, &f).value)
794 794
    end
795
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
795
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
796 796
      assert_equal([h2, {}], t.new(**h2, &f).value)
797 797
    end
798
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
798
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
799 799
      assert_equal([h3, {}], t.new(**h3, &f).value)
800 800
    end
801
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
801
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
802 802
      assert_equal([h3, {}], t.new(a: 1, **h2, &f).value)
803 803
    end
804 804

  
......
830 830
    assert_raise(ArgumentError) { t.new(&f).resume(**h3) }
831 831

  
832 832
    f = ->(a) { a }
833
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
833
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
834 834
      assert_equal(kw, t.new(&f).resume(**{}))
835 835
    end
836
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
836
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
837 837
      assert_equal(kw, t.new(&f).resume(**kw))
838 838
    end
839 839
    assert_equal(h, t.new(&f).resume(**h))
......
850 850
    assert_equal(h2, t.new(&f).resume(**h2))
851 851
    assert_equal(h3, t.new(&f).resume(**h3))
852 852
    assert_equal(h3, t.new(&f).resume(a: 1, **h2))
853
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
853
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
854 854
      assert_equal(h, t.new(&f).resume(h))
855 855
    end
856 856
    assert_raise(ArgumentError) { t.new(&f).resume(h2) }
857
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
857
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
858 858
      assert_raise(ArgumentError) { t.new(&f).resume(h3) }
859 859
    end
860 860

  
861 861
    f = ->(a, **x) { [a,x] }
862
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
862
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
863 863
      assert_equal([{}, {}], t.new(&f).resume(**{}))
864 864
    end
865
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
865
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
866 866
      assert_equal([{}, {}], t.new(&f).resume(**kw))
867 867
    end
868
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
868
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
869 869
      assert_equal([h, {}], t.new(&f).resume(**h))
870 870
    end
871
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
871
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
872 872
      assert_equal([h, {}], t.new(&f).resume(a: 1))
873 873
    end
874
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
874
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
875 875
      assert_equal([h2, {}], t.new(&f).resume(**h2))
876 876
    end
877
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
877
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
878 878
      assert_equal([h3, {}], t.new(&f).resume(**h3))
879 879
    end
880
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
880
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
881 881
      assert_equal([h3, {}], t.new(&f).resume(a: 1, **h2))
882 882
    end
883 883

  
......
907 907
    assert_raise(ArgumentError) { g.new(&f).each(**h3) }
908 908

  
909 909
    f = ->(_, a) { a }
910
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
910
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
911 911
      assert_equal(kw, g.new(&f).each(**{}))
912 912
    end
913
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
913
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
914 914
      assert_equal(kw, g.new(&f).each(**kw))
915 915
    end
916 916
    assert_equal(h, g.new(&f).each(**h))
......
927 927
    assert_equal(h2, g.new(&f).each(**h2))
928 928
    assert_equal(h3, g.new(&f).each(**h3))
929 929
    assert_equal(h3, g.new(&f).each(a: 1, **h2))
930
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
930
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
931 931
      assert_equal(h, g.new(&f).each(h))
932 932
    end
933 933
    assert_raise(ArgumentError) { g.new(&f).each(h2) }
934
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
934
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
935 935
      assert_raise(ArgumentError) { g.new(&f).each(h3) }
936 936
    end
937 937

  
938 938
    f = ->(_, a, **x) { [a,x] }
939
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
939
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
940 940
      assert_equal([{}, {}], g.new(&f).each(**{}))
941 941
    end
942
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
942
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
943 943
      assert_equal([{}, {}], g.new(&f).each(**kw))
944 944
    end
945
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
945
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
946 946
      assert_equal([h, {}], g.new(&f).each(**h))
947 947
    end
948
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
948
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
949 949
      assert_equal([h, {}], g.new(&f).each(a: 1))
950 950
    end
951
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
951
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
952 952
      assert_equal([h2, {}], g.new(&f).each(**h2))
953 953
    end
954
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
954
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
955 955
      assert_equal([h3, {}], g.new(&f).each(**h3))
956 956
    end
957
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
957
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
958 958
      assert_equal([h3, {}], g.new(&f).each(a: 1, **h2))
959 959
    end
960 960

  
......
984 984
    assert_raise(ArgumentError) { g.new{|y| y.yield(**h3)}.each(&f) }
985 985

  
986 986
    f = ->(a) { a }
987
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
987
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
988 988
      assert_equal(kw, g.new{|y| y.yield(**{})}.each(&f))
989 989
    end
990
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
990
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
991 991
      assert_equal(kw, g.new{|y| y.yield(**kw)}.each(&f))
992 992
    end
993 993
    assert_equal(h, g.new{|y| y.yield(**h)}.each(&f))
......
1004 1004
    assert_equal(h2, g.new{|y| y.yield(**h2)}.each(&f))
1005 1005
    assert_equal(h3, g.new{|y| y.yield(**h3)}.each(&f))
1006 1006
    assert_equal(h3, g.new{|y| y.yield(a: 1, **h2)}.each(&f))
1007
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
1007
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
1008 1008
      assert_equal(h, g.new{|y| y.yield(h)}.each(&f))
1009 1009
    end
1010 1010
    assert_raise(ArgumentError) { g.new{|y| y.yield(h2)}.each(&f) }
1011
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
1011
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
1012 1012
      assert_raise(ArgumentError) { g.new{|y| y.yield(h3)}.each(&f) }
1013 1013
    end
1014 1014

  
1015 1015
    f = ->(a, **x) { [a,x] }
1016
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
1016
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
1017 1017
      assert_equal([{}, {}], g.new{|y| y.yield(**{})}.each(&f))
1018 1018
    end
1019
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
1019
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
1020 1020
      assert_equal([{}, {}], g.new{|y| y.yield(**kw)}.each(&f))
1021 1021
    end
1022
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
1022
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
1023 1023
      assert_equal([h, {}], g.new{|y| y.yield(**h)}.each(&f))
1024 1024
    end
1025
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
1025
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
1026 1026
      assert_equal([h, {}], g.new{|y| y.yield(a: 1)}.each(&f))
1027 1027
    end
1028
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
1028
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
1029 1029
      assert_equal([h2, {}], g.new{|y| y.yield(**h2)}.each(&f))
1030 1030
    end
1031
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
1031
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
1032 1032
      assert_equal([h3, {}], g.new{|y| y.yield(**h3)}.each(&f))
1033 1033
    end
1034
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/) do
1034
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/) do
1035 1035
      assert_equal([h3, {}], g.new{|y| y.yield(a: 1, **h2)}.each(&f))
1036 1036
    end
1037 1037

  
......
1087 1087
        @args = args
1088 1088
      end
1089 1089
    end
1090
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1090
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1091 1091
      assert_equal(kw, c[**{}].args)
1092 1092
    end
1093
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1093
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1094 1094
      assert_equal(kw, c[**kw].args)
1095 1095
    end
1096 1096
    assert_equal(h, c[**h].args)
......
1111 1111
    assert_equal(h2, c[**h2].args)
1112 1112
    assert_equal(h3, c[**h3].args)
1113 1113
    assert_equal(h3, c[a: 1, **h2].args)
1114
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `initialize'/m) do
1114
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `initialize'/m) do
1115 1115
      assert_equal(h, c[h].args)
1116 1116
    end
1117 1117
    assert_raise(ArgumentError) { c[h2].args }
1118
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `initialize'/m) do
1118
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `initialize'/m) do
1119 1119
      assert_raise(ArgumentError) { c[h3].args }
1120 1120
    end
1121 1121

  
......
1124 1124
        @args = [arg, args]
1125 1125
      end
1126 1126
    end
1127
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1127
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1128 1128
      assert_equal([kw, kw], c[**{}].args)
1129 1129
    end
1130
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1130
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1131 1131
      assert_equal([kw, kw], c[**kw].args)
1132 1132
    end
1133
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1133
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1134 1134
      assert_equal([h, kw], c[**h].args)
1135 1135
    end
1136
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1136
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1137 1137
      assert_equal([h, kw], c[a: 1].args)
1138 1138
    end
1139
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1139
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1140 1140
      assert_equal([h2, kw], c[**h2].args)
1141 1141
    end
1142
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1142
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1143 1143
      assert_equal([h3, kw], c[**h3].args)
1144 1144
    end
1145
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1145
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1146 1146
      assert_equal([h3, kw], c[a: 1, **h2].args)
1147 1147
    end
1148 1148

  
......
1199 1199
        @args = args
1200 1200
      end
1201 1201
    end.method(:new)
1202
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1202
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1203 1203
      assert_equal(kw, c[**{}].args)
1204 1204
    end
1205
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1205
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1206 1206
      assert_equal(kw, c[**kw].args)
1207 1207
    end
1208 1208
    assert_equal(h, c[**h].args)
......
1223 1223
    assert_equal(h2, c[**h2].args)
1224 1224
    assert_equal(h3, c[**h3].args)
1225 1225
    assert_equal(h3, c[a: 1, **h2].args)
1226
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `initialize'/m) do
1226
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `initialize'/m) do
1227 1227
      assert_equal(h, c[h].args)
1228 1228
    end
1229 1229
    assert_raise(ArgumentError) { c[h2].args }
1230
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `initialize'/m) do
1230
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `initialize'/m) do
1231 1231
      assert_raise(ArgumentError) { c[h3].args }
1232 1232
    end
1233 1233

  
......
1236 1236
        @args = [arg, args]
1237 1237
      end
1238 1238
    end.method(:new)
1239
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1239
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1240 1240
      assert_equal([kw, kw], c[**{}].args)
1241 1241
    end
1242
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1242
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1243 1243
      assert_equal([kw, kw], c[**kw].args)
1244 1244
    end
1245
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1245
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1246 1246
      assert_equal([h, kw], c[**h].args)
1247 1247
    end
1248
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1248
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1249 1249
      assert_equal([h, kw], c[a: 1].args)
1250 1250
    end
1251
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1251
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1252 1252
      assert_equal([h2, kw], c[**h2].args)
1253 1253
    end
1254
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1254
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1255 1255
      assert_equal([h3, kw], c[**h3].args)
1256 1256
    end
1257
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1257
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `initialize'/m) do
1258 1258
      assert_equal([h3, kw], c[a: 1, **h2].args)
1259 1259
    end
1260 1260

  
......
1304 1304
    def c.m(args)
1305 1305
      args
1306 1306
    end
1307
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1307
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1308 1308
      assert_equal(kw, c.method(:m)[**{}])
1309 1309
    end
1310
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1310
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1311 1311
      assert_equal(kw, c.method(:m)[**kw])
1312 1312
    end
1313 1313
    assert_equal(h, c.method(:m)[**h])
......
1327 1327
    assert_equal(h2, c.method(:m)[**h2])
1328 1328
    assert_equal(h3, c.method(:m)[**h3])
1329 1329
    assert_equal(h3, c.method(:m)[a: 1, **h2])
1330
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
1330
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
1331 1331
      assert_equal(h, c.method(:m)[h])
1332 1332
    end
1333 1333
    assert_raise(ArgumentError) { c.method(:m)[h2] }
1334
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
1334
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
1335 1335
      assert_raise(ArgumentError) { c.method(:m)[h3] }
1336 1336
    end
1337 1337

  
......
1339 1339
    def c.m(arg, **args)
1340 1340
      [arg, args]
1341 1341
    end
1342
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1342
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1343 1343
      assert_equal([kw, kw], c.method(:m)[**{}])
1344 1344
    end
1345
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1345
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1346 1346
      assert_equal([kw, kw], c.method(:m)[**kw])
1347 1347
    end
1348
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1348
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1349 1349
      assert_equal([h, kw], c.method(:m)[**h])
1350 1350
    end
1351
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1351
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1352 1352
      assert_equal([h, kw], c.method(:m)[a: 1])
1353 1353
    end
1354
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1354
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1355 1355
      assert_equal([h2, kw], c.method(:m)[**h2])
1356 1356
    end
1357
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1357
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1358 1358
      assert_equal([h3, kw], c.method(:m)[**h3])
1359 1359
    end
1360
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1360
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1361 1361
      assert_equal([h3, kw], c.method(:m)[a: 1, **h2])
1362 1362
    end
1363 1363

  
......
1407 1407
    def c.m(args)
1408 1408
      args
1409 1409
    end
1410
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1410
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1411 1411
      assert_equal(kw, sc.instance_method(:m).bind_call(c, **{}))
1412 1412
    end
1413
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1413
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1414 1414
      assert_equal(kw, sc.instance_method(:m).bind_call(c, **kw))
1415 1415
    end
1416 1416
    assert_equal(h, sc.instance_method(:m).bind_call(c, **h))
......
1430 1430
    assert_equal(h2, sc.instance_method(:m).bind_call(c, **h2))
1431 1431
    assert_equal(h3, sc.instance_method(:m).bind_call(c, **h3))
1432 1432
    assert_equal(h3, sc.instance_method(:m).bind_call(c, a: 1, **h2))
1433
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
1433
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
1434 1434
      assert_equal(h, sc.instance_method(:m).bind_call(c, h))
1435 1435
    end
1436 1436
    assert_raise(ArgumentError) { sc.instance_method(:m).bind_call(c, h2) }
1437
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
1437
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
1438 1438
      assert_raise(ArgumentError) { sc.instance_method(:m).bind_call(c, h3) }
1439 1439
    end
1440 1440

  
......
1442 1442
    def c.m(arg, **args)
1443 1443
      [arg, args]
1444 1444
    end
1445
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1445
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1446 1446
      assert_equal([kw, kw], sc.instance_method(:m).bind_call(c, **{}))
1447 1447
    end
1448
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1448
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1449 1449
      assert_equal([kw, kw], sc.instance_method(:m).bind_call(c, **kw))
1450 1450
    end
1451
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1451
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1452 1452
      assert_equal([h, kw], sc.instance_method(:m).bind_call(c, **h))
1453 1453
    end
1454
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1454
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1455 1455
      assert_equal([h, kw], sc.instance_method(:m).bind_call(c, a: 1))
1456 1456
    end
1457
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1457
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1458 1458
      assert_equal([h2, kw], sc.instance_method(:m).bind_call(c, **h2))
1459 1459
    end
1460
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1460
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1461 1461
      assert_equal([h3, kw], sc.instance_method(:m).bind_call(c, **h3))
1462 1462
    end
1463
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1463
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1464 1464
      assert_equal([h3, kw], sc.instance_method(:m).bind_call(c, a: 1, **h2))
1465 1465
    end
1466 1466

  
......
1509 1509
    def c.m(args)
1510 1510
      args
1511 1511
    end
1512
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1512
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1513 1513
      assert_equal(kw, c.send(:m, **{}))
1514 1514
    end
1515
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1515
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1516 1516
      assert_equal(kw, c.send(:m, **kw))
1517 1517
    end
1518 1518
    assert_equal(h, c.send(:m, **h))
......
1532 1532
    assert_equal(h2, c.send(:m, **h2))
1533 1533
    assert_equal(h3, c.send(:m, **h3))
1534 1534
    assert_equal(h3, c.send(:m, a: 1, **h2))
1535
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
1535
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
1536 1536
      assert_equal(h, c.send(:m, h))
1537 1537
    end
1538 1538
    assert_raise(ArgumentError) { c.send(:m, h2) }
1539
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
1539
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
1540 1540
      assert_raise(ArgumentError) { c.send(:m, h3) }
1541 1541
    end
1542 1542

  
......
1544 1544
    def c.m(arg, **args)
1545 1545
      [arg, args]
1546 1546
    end
1547
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1547
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1548 1548
      c.send(:m, **{})
1549 1549
    end
1550
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1550
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1551 1551
      c.send(:m, **kw)
1552 1552
    end
1553
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1553
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1554 1554
      assert_equal([h, kw], c.send(:m, **h))
1555 1555
    end
1556
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1556
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1557 1557
      assert_equal([h, kw], c.send(:m, a: 1))
1558 1558
    end
1559
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1559
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1560 1560
      assert_equal([h2, kw], c.send(:m, **h2))
1561 1561
    end
1562
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1562
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1563 1563
      assert_equal([h3, kw], c.send(:m, **h3))
1564 1564
    end
1565
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1565
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1566 1566
      assert_equal([h3, kw], c.send(:m, a: 1, **h2))
1567 1567
    end
1568 1568

  
......
1611 1611
    def c.m(args)
1612 1612
      args
1613 1613
    end
1614
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1614
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1615 1615
      assert_equal(kw, c.public_send(:m, **{}))
1616 1616
    end
1617
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1617
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1618 1618
      assert_equal(kw, c.public_send(:m, **kw))
1619 1619
    end
1620 1620
    assert_equal(h, c.public_send(:m, **h))
......
1634 1634
    assert_equal(h2, c.public_send(:m, **h2))
1635 1635
    assert_equal(h3, c.public_send(:m, **h3))
1636 1636
    assert_equal(h3, c.public_send(:m, a: 1, **h2))
1637
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
1637
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
1638 1638
      assert_equal(h, c.public_send(:m, h))
1639 1639
    end
1640 1640
    assert_raise(ArgumentError) { c.public_send(:m, h2) }
1641
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
1641
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
1642 1642
      assert_raise(ArgumentError) { c.public_send(:m, h3) }
1643 1643
    end
1644 1644

  
......
1646 1646
    def c.m(arg, **args)
1647 1647
      [arg, args]
1648 1648
    end
1649
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1649
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1650 1650
      c.public_send(:m, **{})
1651 1651
    end
1652
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1652
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1653 1653
      c.public_send(:m, **kw)
1654 1654
    end
1655
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1655
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1656 1656
      assert_equal([h, kw], c.public_send(:m, **h))
1657 1657
    end
1658
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1658
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1659 1659
      assert_equal([h, kw], c.public_send(:m, a: 1))
1660 1660
    end
1661
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1661
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1662 1662
      assert_equal([h2, kw], c.public_send(:m, **h2))
1663 1663
    end
1664
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1664
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1665 1665
      assert_equal([h3, kw], c.public_send(:m, **h3))
1666 1666
    end
1667
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1667
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1668 1668
      assert_equal([h3, kw], c.public_send(:m, a: 1, **h2))
1669 1669
    end
1670 1670

  
......
1716 1716
      args
1717 1717
    end
1718 1718
    m = c.method(:send)
1719
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1719
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1720 1720
      assert_equal(kw, m.call(:m, **{}))
1721 1721
    end
1722
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1722
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1723 1723
      assert_equal(kw, m.call(:m, **kw))
1724 1724
    end
1725 1725
    assert_equal(h, m.call(:m, **h))
......
1740 1740
    assert_equal(h2, m.call(:m, **h2))
1741 1741
    assert_equal(h3, m.call(:m, **h3))
1742 1742
    assert_equal(h3, m.call(:m, a: 1, **h2))
1743
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
1743
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
1744 1744
      assert_equal(h, m.call(:m, h))
1745 1745
    end
1746 1746
    assert_raise(ArgumentError) { m.call(:m, h2) }
1747
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
1747
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
1748 1748
      assert_raise(ArgumentError) { m.call(:m, h3) }
1749 1749
    end
1750 1750

  
......
1753 1753
      [arg, args]
1754 1754
    end
1755 1755
    m = c.method(:send)
1756
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1756
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1757 1757
      m.call(:m, **{})
1758 1758
    end
1759
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1759
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1760 1760
      m.call(:m, **kw)
1761 1761
    end
1762
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1762
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1763 1763
      assert_equal([h, kw], m.call(:m, **h))
1764 1764
    end
1765
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1765
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1766 1766
      assert_equal([h, kw], m.call(:m, a: 1))
1767 1767
    end
1768
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1768
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1769 1769
      assert_equal([h2, kw], m.call(:m, **h2))
1770 1770
    end
1771
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1771
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1772 1772
      assert_equal([h3, kw], m.call(:m, **h3))
1773 1773
    end
1774
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1774
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1775 1775
      assert_equal([h3, kw], m.call(:m, a: 1, **h2))
1776 1776
    end
1777 1777

  
......
1821 1821
    def c.m(args)
1822 1822
      args
1823 1823
    end
1824
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1824
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1825 1825
      assert_equal(kw, :m.to_proc.call(c, **{}))
1826 1826
    end
1827
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1827
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1828 1828
      assert_equal(kw, :m.to_proc.call(c, **kw))
1829 1829
    end
1830 1830
    assert_equal(h, :m.to_proc.call(c, **h))
......
1844 1844
    assert_equal(h2, :m.to_proc.call(c, **h2))
1845 1845
    assert_equal(h3, :m.to_proc.call(c, **h3))
1846 1846
    assert_equal(h3, :m.to_proc.call(c, a: 1, **h2))
1847
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
1847
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
1848 1848
      assert_equal(h, :m.to_proc.call(c, h))
1849 1849
    end
1850 1850
    assert_raise(ArgumentError) { :m.to_proc.call(c, h2) }
1851
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
1851
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
1852 1852
      assert_raise(ArgumentError) { :m.to_proc.call(c, h3) }
1853 1853
    end
1854 1854

  
......
1856 1856
    def c.m(arg, **args)
1857 1857
      [arg, args]
1858 1858
    end
1859
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1859
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1860 1860
      assert_equal([kw, kw], :m.to_proc.call(c, **{}))
1861 1861
    end
1862
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1862
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1863 1863
      assert_equal([kw, kw], :m.to_proc.call(c, **kw))
1864 1864
    end
1865
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1865
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1866 1866
      assert_equal([h, kw], :m.to_proc.call(c, **h))
1867 1867
    end
1868
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1868
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1869 1869
      assert_equal([h, kw], :m.to_proc.call(c, a: 1))
1870 1870
    end
1871
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1871
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1872 1872
      assert_equal([h2, kw], :m.to_proc.call(c, **h2))
1873 1873
    end
1874
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1874
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1875 1875
      assert_equal([h3, kw], :m.to_proc.call(c, **h3))
1876 1876
    end
1877
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1877
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1878 1878
      assert_equal([h3, kw], :m.to_proc.call(c, a: 1, **h2))
1879 1879
    end
1880 1880

  
......
1924 1924
    def c.m(args)
1925 1925
      args
1926 1926
    end
1927
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1927
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1928 1928
      assert_equal(kw, m.call(c, **{}))
1929 1929
    end
1930
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1930
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1931 1931
      assert_equal(kw, m.call(c, **kw))
1932 1932
    end
1933 1933
    assert_equal(h, m.call(c, **h))
......
1947 1947
    assert_equal(h2, m.call(c, **h2))
1948 1948
    assert_equal(h3, m.call(c, **h3))
1949 1949
    assert_equal(h3, m.call(c, a: 1, **h2))
1950
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
1950
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
1951 1951
      assert_equal(h, m.call(c, h))
1952 1952
    end
1953 1953
    assert_raise(ArgumentError) { m.call(c, h2) }
1954
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
1954
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
1955 1955
      assert_raise(ArgumentError) { m.call(c, h3) }
1956 1956
    end
1957 1957

  
......
1959 1959
    def c.m(arg, **args)
1960 1960
      [arg, args]
1961 1961
    end
1962
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1962
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1963 1963
      assert_equal([kw, kw], m.call(c, **{}))
1964 1964
    end
1965
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1965
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1966 1966
      assert_equal([kw, kw], m.call(c, **kw))
1967 1967
    end
1968
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1968
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1969 1969
      assert_equal([h, kw], m.call(c, **h))
1970 1970
    end
1971
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1971
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1972 1972
      assert_equal([h, kw], m.call(c, a: 1))
1973 1973
    end
1974
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1974
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1975 1975
      assert_equal([h2, kw], m.call(c, **h2))
1976 1976
    end
1977
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1977
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1978 1978
      assert_equal([h3, kw], m.call(c, **h3))
1979 1979
    end
1980
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1980
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `m'/m) do
1981 1981
      assert_equal([h3, kw], m.call(c, a: 1, **h2))
1982 1982
    end
1983 1983

  
......
2026 2026
    def c.method_missing(_, args)
2027 2027
      args
2028 2028
    end
2029
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2029
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2030 2030
      assert_equal(kw, c.m(**{}))
2031 2031
    end
2032
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2032
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2033 2033
      assert_equal(kw, c.m(**kw))
2034 2034
    end
2035 2035
    assert_equal(h, c.m(**h))
......
2049 2049
    assert_equal(h2, c.m(**h2))
2050 2050
    assert_equal(h3, c.m(**h3))
2051 2051
    assert_equal(h3, c.m(a: 1, **h2))
2052
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
2052
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
2053 2053
      assert_equal(h, c.m(h))
2054 2054
    end
2055 2055
    assert_raise(ArgumentError) { c.m(h2) }
2056
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `method_missing'/m) do
2056
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `method_missing'/m) do
2057 2057
      assert_raise(ArgumentError) { c.m(h3) }
2058 2058
    end
2059 2059

  
......
2061 2061
    def c.method_missing(_, arg, **args)
2062 2062
      [arg, args]
2063 2063
    end
2064
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2064
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2065 2065
      assert_equal([kw, kw], c.m(**{}))
2066 2066
    end
2067
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2067
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2068 2068
      assert_equal([kw, kw], c.m(**kw))
2069 2069
    end
2070
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2070
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2071 2071
      assert_equal([h, kw], c.m(**h))
2072 2072
    end
2073
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2073
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2074 2074
      assert_equal([h, kw], c.m(a: 1))
2075 2075
    end
2076
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2076
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2077 2077
      assert_equal([h2, kw], c.m(**h2))
2078 2078
    end
2079
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2079
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2080 2080
      assert_equal([h3, kw], c.m(**h3))
2081 2081
    end
2082
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2082
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2083 2083
      assert_equal([h3, kw], c.m(a: 1, **h2))
2084 2084
    end
2085 2085

  
......
2137 2137
      END
2138 2138
    end
2139 2139
    redef[]
2140
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2140
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2141 2141
      assert_equal(kw, c.m(**{}))
2142 2142
    end
2143 2143
    redef[]
2144
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2144
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2145 2145
      assert_equal(kw, c.m(**kw))
2146 2146
    end
2147 2147
    assert_equal(h, c.m(**h))
......
2161 2161
    assert_equal(h2, c.m(**h2))
2162 2162
    assert_equal(h3, c.m(**h3))
2163 2163
    assert_equal(h3, c.m(a: 1, **h2))
2164
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
2164
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `m'/m) do
2165 2165
      assert_equal(h, c.m(h))
2166 2166
    end
2167 2167
    assert_raise(ArgumentError) { c.m(h2) }
2168
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
2168
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `m'/m) do
2169 2169
      assert_raise(ArgumentError) { c.m(h3) }
2170 2170
    end
2171 2171

  
......
2178 2178
      END
2179 2179
    end
2180 2180
    redef[]
2181
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2181
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2182 2182
      assert_equal([kw, kw], c.m(**{}))
2183 2183
    end
2184 2184
    redef[]
2185
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2185
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2186 2186
      assert_equal([kw, kw], c.m(**kw))
2187 2187
    end
2188 2188
    redef[]
2189
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2189
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2190 2190
      assert_equal([h, kw], c.m(**h))
2191 2191
    end
2192 2192
    redef[]
2193
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2193
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2194 2194
      assert_equal([h, kw], c.m(a: 1))
2195 2195
    end
2196 2196
    redef[]
2197
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2197
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2198 2198
      assert_equal([h2, kw], c.m(**h2))
2199 2199
    end
2200 2200
    redef[]
2201
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2201
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2202 2202
      assert_equal([h3, kw], c.m(**h3))
2203 2203
    end
2204 2204
    redef[]
2205
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2205
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2206 2206
      assert_equal([h3, kw], c.m(a: 1, **h2))
2207 2207
    end
2208 2208

  
......
2252 2252
    def c.method_missing(_, args)
2253 2253
      args
2254 2254
    end
2255
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2255
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2256 2256
      assert_equal(kw, c.m(**{}))
2257 2257
    end
2258
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2258
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2259 2259
      assert_equal(kw, c.m(**kw))
2260 2260
    end
2261 2261
    assert_equal(h, c.m(**h))
......
2275 2275
    assert_equal(h2, c.m(**h2))
2276 2276
    assert_equal(h3, c.m(**h3))
2277 2277
    assert_equal(h3, c.m(a: 1, **h2))
2278
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
2278
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method `method_missing'/m) do
2279 2279
      assert_equal(h, c.m(h))
2280 2280
    end
2281 2281
    assert_raise(ArgumentError) { c.m(h2) }
2282
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `method_missing'/m) do
2282
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method `method_missing'/m) do
2283 2283
      assert_raise(ArgumentError) { c.m(h3) }
2284 2284
    end
2285 2285

  
......
2287 2287
    def c.method_missing(_, arg, **args)
2288 2288
      [arg, args]
2289 2289
    end
2290
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2290
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2291 2291
      assert_equal([kw, kw], c.m(**{}))
2292 2292
    end
2293
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2293
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2294 2294
      assert_equal([kw, kw], c.m(**kw))
2295 2295
    end
2296
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2296
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2297 2297
      assert_equal([h, kw], c.m(**h))
2298 2298
    end
2299
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2299
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2300 2300
      assert_equal([h, kw], c.m(a: 1))
2301 2301
    end
2302
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2302
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2303 2303
      assert_equal([h2, kw], c.m(**h2))
2304 2304
    end
2305
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2305
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2306 2306
      assert_equal([h3, kw], c.m(**h3))
2307 2307
    end
2308
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2308
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated.*The called method `method_missing'/m) do
2309 2309
      assert_equal([h3, kw], c.m(a: 1, **h2))
2310 2310
    end
2311 2311

  
......
2344 2344
    class << c
2345 2345
      define_method(:m) {|arg| arg }
2346 2346
    end
2347
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2347
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2348 2348
      assert_equal(kw, c.m(**{}))
2349 2349
    end
2350
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2350
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2351 2351
      assert_equal(kw, c.m(**kw))
2352 2352
    end
2353 2353
    assert_equal(h, c.m(**h))
......
2379 2379
    assert_equal(h2, c.m(**h2))
2380 2380
    assert_equal(h3, c.m(**h3))
2381 2381
    assert_equal(h3, c.m(a: 1, **h2))
2382
    assert_warn(/Using the last argument as keyword parameters is deprecated/m) do
2382
    assert_warning(/Using the last argument as keyword parameters is deprecated/m) do
2383 2383
      assert_equal(h, c.m(h))
2384 2384
    end
2385 2385
    assert_raise(ArgumentError) { c.m(h2) }
2386
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated/m) do
2386
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated/m) do
2387 2387
      assert_raise(ArgumentError) { c.m(h3) }
2388 2388
    end
2389 2389

  
......
2391 2391
    class << c
2392 2392
      define_method(:m) {|arg, **opt| [arg, opt] }
2393 2393
    end
2394
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2394
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2395 2395
      assert_equal([kw, kw], c.m(**{}))
2396 2396
    end
2397
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2397
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2398 2398
      assert_equal([kw, kw], c.m(**kw))
2399 2399
    end
2400
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2400
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2401 2401
      assert_equal([h, kw], c.m(**h))
2402 2402
    end
2403
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2403
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2404 2404
      assert_equal([h, kw], c.m(a: 1))
2405 2405
    end
2406
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2406
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2407 2407
      assert_equal([h2, kw], c.m(**h2))
2408 2408
    end
2409
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2409
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2410 2410
      assert_equal([h3, kw], c.m(**h3))
2411 2411
    end
2412
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2412
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2413 2413
      assert_equal([h3, kw], c.m(a: 1, **h2))
2414 2414
    end
2415 2415

  
......
2429 2429
    class << c
2430 2430
      define_method(:m) {|*args, **opt| [args, opt] }
2431 2431
    end
2432
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
2432
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
2433 2433
      assert_equal([[], h], c.m(h))
2434 2434
    end
2435
    assert_warn(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
2435
    assert_warning(/Using the last argument as keyword parameters is deprecated.*The called method is defined here/m) do
2436 2436
      assert_equal([[h], h], c.m(h, h))
2437 2437
    end
2438 2438

  
......
2440 2440
    class << c
2441 2441
      define_method(:m) {|arg=nil, a: nil| [arg, a] }
2442 2442
    end
2443
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
2443
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
2444 2444
      assert_equal([h2, 1], c.m(h3))
2445 2445
    end
2446
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
2446
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated.*The called method is defined here/m) do
2447 2447
      assert_equal([h2, 1], c.m(**h3))
2448 2448
    end
2449 2449
  end
......
2472 2472
      define_method(:m) {|arg| arg }
2473 2473
    end
2474 2474
    m = c.method(:m)
2475
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2475
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2476 2476
      assert_equal(kw, m.call(**{}))
2477 2477
    end
2478
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2478
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2479 2479
      assert_equal(kw, m.call(**kw))
2480 2480
    end
2481 2481
    assert_equal(h, m.call(**h))
......
2509 2509
    assert_equal(h2, m.call(**h2))
2510 2510
    assert_equal(h3, m.call(**h3))
2511 2511
    assert_equal(h3, m.call(a: 1, **h2))
2512
    assert_warn(/Using the last argument as keyword parameters is deprecated/m) do
2512
    assert_warning(/Using the last argument as keyword parameters is deprecated/m) do
2513 2513
      assert_equal(h, m.call(h))
2514 2514
    end
2515 2515
    assert_raise(ArgumentError) { m.call(h2) }
2516
    assert_warn(/Splitting the last argument into positional and keyword parameters is deprecated/m) do
2516
    assert_warning(/Splitting the last argument into positional and keyword parameters is deprecated/m) do
2517 2517
      assert_raise(ArgumentError) { m.call(h3) }
2518 2518
    end
2519 2519

  
......
2522 2522
      define_method(:m) {|arg, **opt| [arg, opt] }
2523 2523
    end
2524 2524
    m = c.method(:m)
2525
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2525
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2526 2526
      assert_equal([kw, kw], m.call(**{}))
2527 2527
    end
2528
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2528
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2529 2529
      assert_equal([kw, kw], m.call(**kw))
2530 2530
    end
2531
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2531
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2532 2532
      assert_equal([h, kw], m.call(**h))
2533 2533
    end
2534
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2534
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2535 2535
      assert_equal([h, kw], m.call(a: 1))
2536 2536
    end
2537
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2537
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2538 2538
      assert_equal([h2, kw], m.call(**h2))
2539 2539
    end
2540
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2540
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2541 2541
      assert_equal([h3, kw], m.call(**h3))
2542 2542
    end
2543
    assert_warn(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2543
    assert_warning(/Passing the keyword argument as the last hash parameter is deprecated/m) do
2544 2544
      assert_equal([h3, kw], m.call(a: 1, **h2))
2545 2545
    end
... This diff was truncated because it exceeds the maximum size that can be displayed.