mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Use the dedicated assertion
This commit is contained in:
parent
54c91185c9
commit
f96eaf54a2
1 changed files with 2 additions and 2 deletions
|
@ -352,8 +352,8 @@ module TestStruct
|
|||
|
||||
def test_keyword_args_warning
|
||||
warning = /warning: Passing only keyword arguments to Struct#initialize will behave differently from Ruby 3\.2\./
|
||||
assert_match(warning, EnvUtil.verbose_warning { assert_equal({a: 1}, @Struct.new(:a).new(a: 1).a) })
|
||||
assert_match(warning, EnvUtil.verbose_warning { assert_equal({a: 1}, @Struct.new(:a, keyword_init: nil).new(a: 1).a) })
|
||||
assert_warn(warning) { assert_equal({a: 1}, @Struct.new(:a).new(a: 1).a) }
|
||||
assert_warn(warning) { assert_equal({a: 1}, @Struct.new(:a, keyword_init: nil).new(a: 1).a) }
|
||||
assert_warn('') { assert_equal({a: 1}, @Struct.new(:a).new({a: 1}).a) }
|
||||
assert_warn('') { assert_equal({a: 1}, @Struct.new(:a, :b).new(1, a: 1).b) }
|
||||
assert_warn('') { assert_equal(1, @Struct.new(:a, keyword_init: true).new(a: 1).a) }
|
||||
|
|
Loading…
Reference in a new issue