Class: TurboTest::RSpec::ExampleFormatter
- Inherits:
-
Object
- Object
- TurboTest::RSpec::ExampleFormatter
- Defined in:
- lib/turbo_test/rspec/example_formatter.rb
Instance Method Summary collapse
- #dump_summary(summary) ⇒ Object
- #example_failed(notification) ⇒ Object
- #example_finished(notification) ⇒ Object
-
#initialize(packer) ⇒ ExampleFormatter
constructor
A new instance of ExampleFormatter.
- #output ⇒ Object
Constructor Details
#initialize(packer) ⇒ ExampleFormatter
Returns a new instance of ExampleFormatter.
14 15 16 17 18 |
# File 'lib/turbo_test/rspec/example_formatter.rb', line 14 def initialize(packer) @packer = packer @colorizer = ::RSpec::Core::Formatters::ConsoleCodes end |
Instance Method Details
#dump_summary(summary) ⇒ Object
44 45 46 47 48 49 |
# File 'lib/turbo_test/rspec/example_formatter.rb', line 44 def dump_summary(summary) count = summary.examples.count @packer.write([:count, count]) @packer.flush end |
#example_failed(notification) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/turbo_test/rspec/example_formatter.rb', line 29 def example_failed(notification) example = notification.example presenter = ::RSpec::Core::Formatters::ExceptionPresenter.new(example.exception, example) = { description: example.full_description, location: example.location_rerun_argument, report: presenter.fully_formatted(nil, @colorizer), } @packer.write([:failed, ]) @packer.flush end |
#example_finished(notification) ⇒ Object
24 25 26 27 |
# File 'lib/turbo_test/rspec/example_formatter.rb', line 24 def example_finished(notification) @packer.write([:finished, notification.example.id]) @packer.flush end |
#output ⇒ Object
20 21 22 |
# File 'lib/turbo_test/rspec/example_formatter.rb', line 20 def output @packer end |