class RSpec::Mocks::ArgumentListMatcher
def args_match?(*actual_args)
Experimental RBS support (using type sampling data from the type_fusion
project).
def args_match?: (*Array[] actual_args, **unused **) -> true
This signature was generated using 2 samples from 1 application.
- See: #initialize -
Parameters:
-
actual_args
(Array
) --
Other tags:
- Api: - public
def args_match?(*actual_args) expected_args = resolve_expected_args_based_on(actual_args) return false if expected_args.size != actual_args.size if RUBY_VERSION >= "3" # If the expectation was set with keywords, while the actual method was called with a positional hash argument, they don't match. # If the expectation was set without keywords, e.g., with({a: 1}), then it fine to call it with either foo(a: 1) or foo({a: 1}). # This corresponds to Ruby semantics, as if the method was def foo(options). if Hash === expected_args.last && Hash === actual_args.last if !Hash.ruby2_keywords_hash?(actual_args.last) && Hash.ruby2_keywords_hash?(expected_args.last) return false end end end Support::FuzzyMatcher.values_match?(expected_args, actual_args) end