Class: RspecNumberedDocumentation::Formatter
- Inherits:
-
RSpec::Core::Formatters::DocumentationFormatter
- Object
- RSpec::Core::Formatters::DocumentationFormatter
- RspecNumberedDocumentation::Formatter
- Defined in:
- lib/rspec_numbered_documentation/formatter.rb
Overview
Rspec formatter which prefixes the documentation formatter with line numbers indicating the order of test execution.
Instance Method Summary collapse
- #example_started(_notification) ⇒ Object
-
#initialize(output) ⇒ Formatter
constructor
A new instance of Formatter.
Constructor Details
#initialize(output) ⇒ Formatter
Returns a new instance of Formatter.
10 11 12 13 |
# File 'lib/rspec_numbered_documentation/formatter.rb', line 10 def initialize(output) super(output) @example_number = 0 end |
Instance Method Details
#example_started(_notification) ⇒ Object
15 16 17 18 |
# File 'lib/rspec_numbered_documentation/formatter.rb', line 15 def example_started(_notification) @example_number += 1 output.print "#{@example_number}: " end |