class Spectator::Arguments(Args, KWArgs)
Overview
Arguments used in a method call.
Can also be used to match arguments.
Args must be a Tuple
representing the standard arguments.
KWArgs must be a NamedTuple
type representing extra keyword arguments.
Defined in:
spectator/mocks/arguments.crConstructors
-
.new(args : Args, kwargs : KWArgs)
Creates arguments used in a method call.
Class Method Summary
-
.any : AbstractArguments | Nil
Returns unconstrained arguments.
-
.capture(*args, **kwargs)
Friendlier constructor for capturing arguments.
-
.none : AbstractArguments
Instance of empty arguments.
Instance Method Summary
-
#==(other : AbstractArguments)
Checks if this set of arguments and another are equal.
-
#===(other : Arguments)
Checks if another set of arguments matches this set of arguments.
-
#===(other : FormalArguments)
Checks if another set of arguments matches this set of arguments.
-
#[](index : Int)
Returns the positional argument at the specified index.
-
#[](arg : Symbol)
Returns the specified named argument.
-
#args : Args
Positional arguments.
-
#kwargs : KWArgs
Keyword arguments.
-
#named : NamedTuple
Returns all named positional and keyword arguments as a named tuple.
-
#positional : Tuple
Returns all arguments and splatted arguments as a tuple.
-
#to_s(io : IO) : Nil
Constructs a string representation of the arguments.
Instance methods inherited from class Spectator::AbstractArguments
inspect(io : IO) : Nil
inspect
Instance methods inherited from class Object
should(matcher : Spectator::Matchers::TypeMatcher(U), message = nil, *, _file = __FILE__, _line = __LINE__) forall Ushould(matcher, message = nil, *, _file = __FILE__, _line = __LINE__) should, should_eventually(matcher, message = nil, *, _file = __FILE__, _line = __LINE__) should_eventually, should_never(matcher, message = nil, *, _file = __FILE__, _line = __LINE__) should_never, should_not(matcher : Spectator::Matchers::TypeMatcher(U), message = nil, *, _file = __FILE__, _line = __LINE__) forall U
should_not(matcher : Spectator::Matchers::NilMatcher, message = nil, *, _file = __FILE__, _line = __LINE__)
should_not(matcher, message = nil, *, _file = __FILE__, _line = __LINE__) should_not
Constructor Detail
Class Method Detail
Instance Method Detail
Checks if another set of arguments matches this set of arguments.
Checks if another set of arguments matches this set of arguments.