aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2020-09-02 15:49:40 -0700
committerJeremy Evans <code@jeremyevans.net>2020-09-28 08:38:06 -0700
commit92c3ad9c276d048bf6fba1145ffccf8678fe8af1 (patch)
tree8d5eb4c4bcfc9871e95d6596758fdb590649e00b /test
parent5d7953f86b7ae164017e2292dfb3c108e0e02527 (diff)
downloadruby-92c3ad9c276d048bf6fba1145ffccf8678fe8af1.tar.gz
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.
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_exception.rb4
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|