aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-17 21:55:48 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-17 21:55:48 +0900
commitf96eaf54a2f0662749c9d43bbbe861d905b6492f (patch)
tree310b0bcbf91a371db168e972f9cffc04aef12ef4
parent54c91185c9273b9699693910fa95383c86f2af22 (diff)
downloadruby-f96eaf54a2f0662749c9d43bbbe861d905b6492f.tar.gz
Use the dedicated assertion
-rw-r--r--test/ruby/test_struct.rb4
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) }