Class: TestRunner::ExampleResult
- Inherits:
 - 
      Object
      
        
- Object
 - TestRunner::ExampleResult
 
 
- Defined in:
 - lib/test-runner/example_result.rb
 
Instance Attribute Summary collapse
- #elapsed_time ⇒ Float readonly
 - #example ⇒ Example readonly
 - #exception ⇒ Exception readonly
 
Instance Method Summary collapse
- #error ⇒ Object
 - #failure? ⇒ Boolean
 - 
  
    
      #initialize(example, elapsed_time, exception = nil)  ⇒ ExampleResult 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of ExampleResult.
 - #pending? ⇒ Boolean
 - #skip? ⇒ Boolean
 - #success? ⇒ Boolean
 - #title ⇒ Object
 
Constructor Details
#initialize(example, elapsed_time, exception = nil) ⇒ ExampleResult
Returns a new instance of ExampleResult.
      15 16 17 18 19  | 
    
      # File 'lib/test-runner/example_result.rb', line 15 def initialize(example, elapsed_time, exception = nil) @example = example @elapsed_time = elapsed_time @exception = exception end  | 
  
Instance Attribute Details
#elapsed_time ⇒ Float (readonly)
      10 11 12  | 
    
      # File 'lib/test-runner/example_result.rb', line 10 def elapsed_time @elapsed_time end  | 
  
#example ⇒ Example (readonly)
      4 5 6  | 
    
      # File 'lib/test-runner/example_result.rb', line 4 def example @example end  | 
  
#exception ⇒ Exception (readonly)
      7 8 9  | 
    
      # File 'lib/test-runner/example_result.rb', line 7 def exception @exception end  | 
  
Instance Method Details
#error ⇒ Object
      45 46 47 48 49 50 51 52 53  | 
    
      # File 'lib/test-runner/example_result.rb', line 45 def error if @example.pending? "Example that was pending due to '#{@example.reason}' unexpectedly succeeded" elsif @example.skip? @example.reason else @exception. end end  | 
  
#failure? ⇒ Boolean
      29 30 31  | 
    
      # File 'lib/test-runner/example_result.rb', line 29 def failure? !success? end  | 
  
#pending? ⇒ Boolean
      33 34 35  | 
    
      # File 'lib/test-runner/example_result.rb', line 33 def pending? @example.pending? end  | 
  
#skip? ⇒ Boolean
      37 38 39  | 
    
      # File 'lib/test-runner/example_result.rb', line 37 def skip? @example.skip? end  | 
  
#success? ⇒ Boolean
      21 22 23 24 25 26 27  | 
    
      # File 'lib/test-runner/example_result.rb', line 21 def success? if @example.pending? !@exception.nil? else @example.skip? || @exception.nil? end end  | 
  
#title ⇒ Object
      41 42 43  | 
    
      # File 'lib/test-runner/example_result.rb', line 41 def title example. end  |