Class: Buildr::TestFramework::TestResult::YamlFormatter
- Defined in:
- lib/buildr/java/test_result.rb
Overview
An Rspec formatter used by buildr
Instance Attribute Summary collapse
- 
  
    
      #example_group  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute example_group. 
- 
  
    
      #options  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute options. 
- 
  
    
      #result  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute result. 
- 
  
    
      #where  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute where. 
Instance Method Summary collapse
- #close ⇒ Object
- #example_failed(example, counter, failure) ⇒ Object
- #example_group_started(example_group) ⇒ Object
- #example_passed(example) ⇒ Object
- #example_pending(example, counter) ⇒ Object
- 
  
    
      #initialize(options, where)  ⇒ YamlFormatter 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of YamlFormatter. 
- #start(example_count) ⇒ Object
Constructor Details
#initialize(options, where) ⇒ YamlFormatter
Returns a new instance of YamlFormatter.
| 58 59 60 61 62 63 64 | # File 'lib/buildr/java/test_result.rb', line 58 def initialize(, where) @options = @where = where @result = Hash.new @result[:succeeded] = [] @result[:failed] = [] end | 
Instance Attribute Details
#example_group ⇒ Object
Returns the value of attribute example_group.
| 56 57 58 | # File 'lib/buildr/java/test_result.rb', line 56 def example_group @example_group end | 
#options ⇒ Object
Returns the value of attribute options.
| 56 57 58 | # File 'lib/buildr/java/test_result.rb', line 56 def @options end | 
#result ⇒ Object (readonly)
Returns the value of attribute result.
| 54 55 56 | # File 'lib/buildr/java/test_result.rb', line 54 def result @result end | 
#where ⇒ Object
Returns the value of attribute where.
| 56 57 58 | # File 'lib/buildr/java/test_result.rb', line 56 def where @where end | 
Instance Method Details
#close ⇒ Object
| 91 92 93 94 95 | # File 'lib/buildr/java/test_result.rb', line 91 def close result.succeeded = result.succeeded - result.failed FileUtils.mkdir_p File.dirname(where) File.open(where, 'w') { |f| f.puts YAML.dump(result) } end | 
#example_failed(example, counter, failure) ⇒ Object
| 83 84 85 | # File 'lib/buildr/java/test_result.rb', line 83 def example_failed(example, counter, failure) result.failed << example_name(example) end | 
#example_group_started(example_group) ⇒ Object
| 71 72 73 | # File 'lib/buildr/java/test_result.rb', line 71 def example_group_started(example_group) @example_group = example_group end | 
#example_passed(example) ⇒ Object
| 75 76 77 | # File 'lib/buildr/java/test_result.rb', line 75 def example_passed(example) result.succeeded << example_name(example) end | 
#example_pending(example, counter) ⇒ Object
| 79 80 81 | # File 'lib/buildr/java/test_result.rb', line 79 def example_pending(example, counter) result.succeeded << example_name(example) end | 
#start(example_count) ⇒ Object
| 87 88 89 | # File 'lib/buildr/java/test_result.rb', line 87 def start(example_count) @result = TestResult.new end |