ruby-changes:64919
From: Nobuyoshi <ko1@a...>
Date: Sun, 17 Jan 2021 21:56:11 +0900 (JST)
Subject: [ruby-changes:64919] f96eaf54a2 (master): Use the dedicated assertion
https://git.ruby-lang.org/ruby.git/commit/?id=f96eaf54a2 From f96eaf54a2f0662749c9d43bbbe861d905b6492f Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sun, 17 Jan 2021 21:55:48 +0900 Subject: Use the dedicated assertion diff --git a/test/ruby/test_struct.rb b/test/ruby/test_struct.rb index dc6a0b9..7426282 100644 --- a/test/ruby/test_struct.rb +++ b/test/ruby/test_struct.rb @@ -352,8 +352,8 @@ module TestStruct https://github.com/ruby/ruby/blob/trunk/test/ruby/test_struct.rb#L352 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) } -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/