Skip to content

Commit

Permalink
for >3.2 need ruby2_keywords on all methods in the call path
Browse files Browse the repository at this point in the history
  • Loading branch information
malcolmohare committed Feb 27, 2024
1 parent fd1dbb6 commit 75432d1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/rspec/support/method_signature_verifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def has_kw_args_in?(args) # rubocop:disable Metrics/CyclomaticComplexity, Metric
(args.last.empty? || args.last.keys.any? { |x| x.is_a?(Symbol) })
end
end
ruby2_keywords(:has_kw_args_in?) if respond_to?(:ruby2_keywords, true)

# Without considering what the last arg is, could it
# contain keyword arguments?
Expand Down Expand Up @@ -309,6 +310,7 @@ def initialize(signature, args=[])
@min_non_kw_args = @max_non_kw_args = @non_kw_args
@arbitrary_kw_args = @unlimited_args = false
end
ruby2_keywords(:initialize) if respond_to?(:ruby2_keywords, true)

def with_expectation(expectation) # rubocop:disable Metrics/MethodLength
return self unless MethodSignatureExpectation === expectation
Expand Down Expand Up @@ -459,6 +461,7 @@ def valid_non_kw_args?(*args)
def has_kw_args_in?(args)
@signature.has_kw_args_in?(args)
end
ruby2_keywords(:has_kw_args_in?) if respond_to?(:ruby2_keywords, true)
end
end
end
Expand Down

0 comments on commit 75432d1

Please sign in to comment.