diff options
author | Jeremy Evans <[email protected]> | 2020-09-02 15:49:40 -0700 |
---|---|---|
committer | Jeremy Evans <[email protected]> | 2020-09-28 08:38:06 -0700 |
commit | 92c3ad9c276d048bf6fba1145ffccf8678fe8af1 (patch) | |
tree | 8d5eb4c4bcfc9871e95d6596758fdb590649e00b /test/ruby/test_exception.rb | |
parent | 5d7953f86b7ae164017e2292dfb3c108e0e02527 (diff) |
Make Warning.warn accept only category keyword
In general accepting arbitrary keywords is a bad idea unless you are
delegating keywords or acting on arbitrary keywords. In this case,
the category keyword is ignored, and it's less error prone to not
ignore all keywords.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3508
Diffstat (limited to 'test/ruby/test_exception.rb')
-rw-r--r-- | test/ruby/test_exception.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index 120b041830..0333fd52ea 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -925,8 +925,8 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status| remove_method :warn if category - define_method(:warn) do |str, **kw| - warning << [str, kw[:category]] + define_method(:warn) do |str, category: nil| + warning << [str, category] end else define_method(:warn) do |str| |