Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 2ca170b

Browse files
bryanppirj
authored andcommitted
Avoid respond_to? when checking existence of the ruby2_keywords method
Using `respond_to?` causes issues in rspec-rails because of how the `Railtie` class implements `respond_to_missing?`.
1 parent c5f4d54 commit 2ca170b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rspec/mocks/method_double.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def define_proxy_method
6363
define_method(method_name) do |*args, &block|
6464
method_double.proxy_method_invoked(self, *args, &block)
6565
end
66-
ruby2_keywords(method_name) if respond_to?(:ruby2_keywords, true)
66+
ruby2_keywords(method_name) if Module.private_method_defined?(:ruby2_keywords)
6767
__send__(visibility, method_name)
6868
end
6969

0 commit comments

Comments
 (0)