class Spectator::Arguments(T, NT)

Overview

Arguments used in a method call.

Can also be used to match arguments. T must be a Tuple type representing the positional arguments. NT must be a NamedTuple type representing the keyword arguments.

Defined in:

spectator/mocks/arguments.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Object

should(matcher, message = nil) should, should_eventually(matcher, message = nil) should_eventually, should_never(matcher, message = nil) should_never, should_not(matcher, message = nil) should_not

Constructor Detail

def self.new(args : T, kwargs : NT) #

Creates arguments used in a method call.


[View source]

Class Method Detail

def self.any : AbstractArguments | Nil #

Returns unconstrained arguments.


[View source]
def self.capture(*args, **kwargs) : AbstractArguments #

Constructs an instance from literal arguments.


[View source]
def self.none : AbstractArguments #

Instance of empty arguments.


[View source]

Instance Method Detail

def ==(other : Arguments) #

Checks if this set of arguments and another are equal.


[View source]
def ===(other : Arguments) #

Checks if another set of arguments matches this set of arguments.


[View source]
def [](index : Int) #

Returns the positional argument at the specified index.


[View source]
def [](arg : Symbol) #

Returns the specified named argument.


[View source]
def args : T #

Positional arguments.


[View source]
def kwargs : NT #

Keyword arguments.


[View source]
def to_s(io : IO) : Nil #

Constructs a string representation of the arguments.


[View source]