struct

Spectator::Matchers::Matcher

Inherits Struct / Value / Object

Common base class for all expectation conditions. A matcher looks at something produced by the SUT and evaluates whether it is correct or not.

Constructors

Instance methods

===(actual : Expression(T)) : Bool

Compares a matcher against a value. Enables composable matchers.

Source
===(other) : Bool

Compares a matcher against a value. Enables composable matchers.

Source
description

Short text about the matcher's purpose. This explains what condition satisfies the matcher. The description is used when the one-liner syntax is used.

it { is_expected.to do_something }

The phrasing should be such that it reads "it ___." where the blank is what is returned by this method.

Source
initialize
Source
match(actual : Expression(T)) : MatchData forall T

Actually performs the test against the expression (value or block).

Source
negated_match(actual : Expression(T)) : MatchData forall T

Performs the test against the expression (value or block), but inverted. A successful match with #match should normally fail for this method, and vice-versa.

Source