Class: Buildr::TestFramework::TestResult::YamlFormatter
- Inherits:
-
RSpec::Core::Formatters::BaseFormatter
- Object
- RSpec::Core::Formatters::BaseFormatter
- Buildr::TestFramework::TestResult::YamlFormatter
- Defined in:
- lib/buildr/java/test_result.rb
Overview
An Rspec formatter used by buildr
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #close ⇒ Object
- #example_failed(example) ⇒ Object
- #example_passed(example) ⇒ Object
- #example_pending(example) ⇒ Object
-
#initialize(output) ⇒ YamlFormatter
constructor
A new instance of YamlFormatter.
- #start(example_count) ⇒ Object
Constructor Details
#initialize(output) ⇒ YamlFormatter
Returns a new instance of YamlFormatter.
60 61 62 63 64 65 |
# File 'lib/buildr/java/test_result.rb', line 60 def initialize(output) super(output) @result = Hash.new @result[:succeeded] = [] @result[:failed] = [] end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
58 59 60 |
# File 'lib/buildr/java/test_result.rb', line 58 def result @result end |
Instance Method Details
#close ⇒ Object
87 88 89 90 91 |
# File 'lib/buildr/java/test_result.rb', line 87 def close super result.succeeded = result.succeeded - result.failed output.puts YAML.dump(result) end |
#example_failed(example) ⇒ Object
77 78 79 80 |
# File 'lib/buildr/java/test_result.rb', line 77 def example_failed(example) super(example) result.failed << example_name(example) end |
#example_passed(example) ⇒ Object
67 68 69 70 |
# File 'lib/buildr/java/test_result.rb', line 67 def example_passed(example) super(example) result.succeeded << example_name(example) end |
#example_pending(example) ⇒ Object
72 73 74 75 |
# File 'lib/buildr/java/test_result.rb', line 72 def example_pending(example) super(example) result.succeeded << example_name(example) end |
#start(example_count) ⇒ Object
82 83 84 85 |
# File 'lib/buildr/java/test_result.rb', line 82 def start(example_count) super(example_count) @result = TestResult.new end |