diff options
author | Nobuyoshi Nakada <[email protected]> | 2021-01-17 21:55:48 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2021-01-17 21:55:48 +0900 |
commit | f96eaf54a2f0662749c9d43bbbe861d905b6492f (patch) | |
tree | 310b0bcbf91a371db168e972f9cffc04aef12ef4 /test/ruby/test_struct.rb | |
parent | 54c91185c9273b9699693910fa95383c86f2af22 (diff) |
Use the dedicated assertion
Diffstat (limited to 'test/ruby/test_struct.rb')
-rw-r--r-- | test/ruby/test_struct.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/ruby/test_struct.rb b/test/ruby/test_struct.rb index dc6a0b99fd..7426282beb 100644 --- a/test/ruby/test_struct.rb +++ b/test/ruby/test_struct.rb @@ -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) } |