Reword keyword arguments warning messages to convey these are deprecation warnings

This commit is contained in:
Marc-Andre Lafortune 2019-12-23 02:34:16 -05:00
parent df6f5c44af
commit 819b604037
14 changed files with 501 additions and 501 deletions

View file

@ -115,7 +115,7 @@ module TestStruct
assert_equal "#{@Struct}::KeywordInitTrue(keyword_init: true)", @Struct::KeywordInitTrue.inspect
# eval is needed to prevent the warning duplication filter
k = eval("Class.new(@Struct::KeywordInitFalse) {def initialize(**) end}")
assert_warn(/The last argument is used as keyword parameters/) {k.new(a: 1, b: 2)}
assert_warn(/Using the last argument as keyword parameters is deprecated/) {k.new(a: 1, b: 2)}
k = Class.new(@Struct::KeywordInitTrue) {def initialize(**) end}
assert_warn('') {k.new(a: 1, b: 2)}