Merge pull request #42954 from kamipo/fix_per_thread_registry

Fix kwargs delegation in `PerThreadRegistry#method_missing`
This commit is contained in:
Ryuta Kamizono 2021-08-06 18:39:16 +09:00 committed by GitHub
commit 58dc8b634b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -56,5 +56,6 @@ module ActiveSupport
send(name, *args, &block)
end
ruby2_keywords(:method_missing)
end
end

View File

@ -0,0 +1,15 @@
# frozen_string_literal: true
require_relative "abstract_unit"
class PerThreadRegistryTest < ActiveSupport::TestCase
class TestRegistry
extend ActiveSupport::PerThreadRegistry
def foo(x:); x; end
end
def test_method_missing_with_kwargs
assert_equal 1, TestRegistry.foo(x: 1)
end
end