class Spectator::Value(T)
Overview
Represents a value from a test.
This is typically captured by an expect macro.
It consists of a label and the value of the expression.
The label should be a string recognizable by the user,
or nil if one isn't available.
Defined in:
spectator/value.crConstructors
- 
        .new(value : T, label : Label)
        
          Creates the value. 
- 
        .new(value : T)
        
          Creates the value. 
Instance Method Summary
- 
        #value : T
        
          Raw value of the expression. 
Instance methods inherited from class Spectator::Expression(T)
  
  
    
      raw_value
    raw_value, 
    
  
    
      value : T
    value
    
  
    
  Constructor methods inherited from class Spectator::Expression(T)
  
  
    
      new(label : Label)
    new
    
  
    
  
    
  Instance methods inherited from class Spectator::AbstractExpression
  
  
    
      cast(type : T.class) : T forall T
    cast, 
    
  
    
      inspect(io)
    inspect, 
    
  
    
      label : Label
    label, 
    
  
    
      raw_value
    raw_value, 
    
  
    
      to_s(io)
    to_s
    
  
    
  Constructor methods inherited from class Spectator::AbstractExpression
  
  
    
      new(label : Label)
    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
Creates the value. Expects the value of the expression and a label describing it. The label is usually the Crystal code evaluating to the value.
        
        def self.new(value : T)
        #
      
      
        Creates the value.
Expects the value of the expression.
It can be nil if it isn't available.
A label is generated by calling #inspect on the value.