struct Spectator::Expectation::Target(T)
- Spectator::Expectation::Target(T)
- Struct
- Value
- Object
Overview
Stores part of an expectation.
This covers the actual value (or block) being inspected and its location.
This is the type returned by an expect block in the DSL.
It is not intended to be used directly, but instead by chaining methods.
Typically #to and #not_to are used.
Defined in:
spectator/expectation.crConstructors
- 
        .new(expression : Expression(T), location : Location)
        
          Creates the expectation target. 
Instance Method Summary
- 
        #never_to(matcher, message = nil) : Nil
        
          Asserts that some criteria defined by the matcher is never satisfied. 
- #not_to(stubs : Enumerable(Mocks::MethodStub)) : Nil
- #not_to(stub : Mocks::MethodStub) : Nil
- 
        #not_to(matcher, message = nil) : Nil
        
          Asserts that some criteria defined by the matcher is not satisfied. 
- #to(stubs : Enumerable(Mocks::MethodStub)) : Nil
- #to(stub : Mocks::MethodStub) : Nil
- 
        #to(matcher, message = nil) : Nil
        
          Asserts that some criteria defined by the matcher is satisfied. 
- #to_eventually(stubs : Enumerable(Mocks::MethodStub)) : Nil
- #to_eventually(stub : Mocks::MethodStub) : Nil
- 
        #to_eventually(matcher, message = nil) : Nil
        
          Asserts that some criteria defined by the matcher is eventually satisfied. 
- #to_never(stub : Enumerable(Mocks::MethodStub)) : Nil
- #to_never(stub : Mocks::MethodStub) : Nil
- 
        #to_never(matcher, message = nil) : Nil
        
          Asserts that some criteria defined by the matcher is never satisfied. 
- #to_not(stubs : Enumerable(Mocks::MethodStub)) : Nil
- #to_not(stub : Mocks::MethodStub) : Nil
- 
        #to_not(matcher, message = nil) : Nil
        
          Asserts that some criteria defined by the matcher is not satisfied. 
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
Creates the expectation target. The expression is the actual value being tested and its label. The location is the location of where this expectation was defined.
Instance Method Detail
Asserts that some criteria defined by the matcher is never satisfied. The expectation is checked after the example finishes and all hooks have run. Allows a custom message to be used.
Asserts that some criteria defined by the matcher is not satisfied.
This is effectively the opposite of #to.
Allows a custom message to be used.
Asserts that some criteria defined by the matcher is satisfied. Allows a custom message to be used.
Asserts that some criteria defined by the matcher is eventually satisfied. The expectation is checked after the example finishes and all hooks have run. Allows a custom message to be used.
Asserts that some criteria defined by the matcher is never satisfied. The expectation is checked after the example finishes and all hooks have run. Allows a custom message to be used.