class RSpec::Mocks::ArgumentListMatcher
def initialize(*expected_args, &block)
- See: #args_match? -
See: ArgumentMatchers -
Parameters:
-
block
(Block
) -- a block with arity matching the expected -
*expected_args
(Array
) -- a list of expected literals and/or argument matchers
Other tags:
- Api: - public
def initialize(*expected_args, &block) @expected_args = expected_args @block = expected_args.empty? ? block : nil @match_any_args = false @matchers = nil case expected_args.first when ArgumentMatchers::AnyArgsMatcher @match_any_args = true when ArgumentMatchers::NoArgsMatcher @matchers = [] else @matchers = expected_args.collect {|arg| matcher_for(arg)} end end