Update tests for full keyword argument separation

This commit is contained in:
Jeremy Evans 2019-10-04 15:41:13 -07:00
parent beae6cbf0f
commit ff96565686
Notes: git 2020-01-03 11:41:09 +09:00
12 changed files with 556 additions and 1694 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(/Using the last argument as keyword parameters is deprecated/) {k.new(a: 1, b: 2)}
assert_raise(ArgumentError) { k.new(a: 1, b: 2) }
k = Class.new(@Struct::KeywordInitTrue) {def initialize(**) end}
assert_warn('') {k.new(a: 1, b: 2)}