struct Spectator::Matchers::ReceiveMatcher
- Spectator::Matchers::ReceiveMatcher
- Spectator::Matchers::StandardMatcher
- Spectator::Matchers::Matcher
- Struct
- Value
- Object
Defined in:
spectator/matchers/receive_matcher.crConstructors
Instance Method Summary
- #at_least(count)
- #at_least_once
- #at_least_twice
- #at_most(count)
- #at_most_once
- #at_most_twice
- 
        #description : String
        
          Short text about the matcher's purpose. 
- #exactly(count)
- 
        #failure_message(actual : Expression(T)) : String forall T
        
          Message displayed when the matcher isn't satisfied. 
- #failure_message_when_negated(actual) : String
- #humanize_range(range : Range)
- 
        #match?(actual : Expression(T)) : Bool forall T
        
          Checks whether the matcher is satisfied with the expression given to it. 
- 
        #negated_values(actual : Expression(T)) forall T
        
          Additional information about the match failure when negated. 
- #once
- #twice
- 
        #values(actual : Expression(T)) forall T
        
          Additional information about the match failure. 
- #with(*args, **opts)
Instance methods inherited from struct Spectator::Matchers::StandardMatcher
  
  
    
      match(actual : Expression(T)) : MatchData forall T
    match, 
    
  
    
      negated_match(actual : Expression(T)) : MatchData forall T
    negated_match
    
  
    
    
  
    
  Instance methods inherited from struct Spectator::Matchers::Matcher
  
  
    
      description : String
    description, 
    
  
    
      initialize
    initialize, 
    
  
    
      match(actual : Expression(T)) : MatchData forall T
    match, 
    
  
    
      negated_match(actual : Expression(T)) : MatchData forall T
    negated_match
    
  
    
  Constructor methods inherited from struct Spectator::Matchers::Matcher
  
  
    
      new
    new
    
  
    
  
    
    
    
  
    
    
    
  
    
  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
Instance Method Detail
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.
Message displayed when the matcher isn't satisfied.
This is only called when #match? returns false.
The message should typically only contain the test expression labels.
Actual values should be returned by #values.
Checks whether the matcher is satisfied with the expression given to it.
Additional information about the match failure when negated.
By default, just the actual value is produced (same as #values).
The return value must be a NamedTuple with Strings for each value.
The tuple can be of any size,
but the keys must be known at compile-time (as Symbols),
and the values must be strings.
Generally, the string values are produced by calling #inspect on the relevant object.
It should look like this:
{
  expected: "Not foo",
  actual:   "bar",
}The values should typically only contain the test expression values, not the labels.
Labeled should be returned by #failure_message_when_negated.
Additional information about the match failure.
By default, just the actual value is produced.
The return value must be a NamedTuple with Strings for each value.
The tuple can be of any size,
but the keys must be known at compile-time (as Symbols),
and the values must be strings.
Generally, the string values are produced by calling #inspect on the relevant object.
It should look like this:
{
  expected: "foo",
  actual:   "bar",
}The values should typically only contain the test expression values, not the labels.
Labeled should be returned by #failure_message.