class

Mocks::ArgumentsPattern(Positional, KeywordArguments)

Inherits Mocks::AbstractArgumentsPattern < Reference < Object

Arguments matched against to determine if a stub should be used or a call had expected arguments.

The Positional type parameter must be a Tuple. The KeywordArguments type parameter must be a NamedTuple.

Constructors

new(positional : Positional, named : KeywordArguments)

Creates a pattern to match against arguments passed to a method.

Source

Class methods

any

Returns a value that matches against any and all arguments.

Source
build(*args, **named) : AbstractArgumentsPattern

Creates a pattern to match against arguments written as a normal parameter list.

Source
none

Creates an empty set of arguments to match against. Matching against this indicates no arguments were passed.

Source

Instance methods

==(other : self)

Returns true if this reference is the same as other. Invokes same?.

===(other : Arguments(Args, Splat, DoubleSplat)) : Bool forall Args, Splat, DoubleSplat

Checks if arguments passed to a method match those specified by this pattern.

Source
hash(hasher)

See Object#hash(hasher)

named

Keyword arguments.

Source
positional

Positional arguments.

Source
to_args

Returns the arguments as-if they were passed to a method.

Source
to_s(io : IO) : Nil

Generates the string representation of the argument pattern.

Source