mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 17:14:01 +02:00
Update tests for full keyword argument separation
This commit is contained in:
parent
beae6cbf0f
commit
ff96565686
Notes:
git
2020-01-03 11:41:09 +09:00
12 changed files with 556 additions and 1694 deletions
|
@ -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)}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue