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.
61 62 63 64 65 66 |
# File 'lib/buildr/java/test_result.rb', line 61 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.
59 60 61 |
# File 'lib/buildr/java/test_result.rb', line 59 def result @result end |
Instance Method Details
#close ⇒ Object
88 89 90 91 92 |
# File 'lib/buildr/java/test_result.rb', line 88 def close super result.succeeded = result.succeeded - result.failed output.puts YAML.dump(result) end |
#example_failed(example) ⇒ Object
78 79 80 81 |
# File 'lib/buildr/java/test_result.rb', line 78 def example_failed(example) super(example) result.failed << example_name(example) end |
#example_passed(example) ⇒ Object
68 69 70 71 |
# File 'lib/buildr/java/test_result.rb', line 68 def example_passed(example) super(example) result.succeeded << example_name(example) end |
#example_pending(example) ⇒ Object
73 74 75 76 |
# File 'lib/buildr/java/test_result.rb', line 73 def example_pending(example) super(example) result.succeeded << example_name(example) end |
#start(example_count) ⇒ Object
83 84 85 86 |
# File 'lib/buildr/java/test_result.rb', line 83 def start(example_count) super(example_count) @result = TestResult.new end |