Class: Vigia::Formatter
- Inherits:
-
RSpec::Core::Formatters::BaseTextFormatter
- Object
- RSpec::Core::Formatters::BaseTextFormatter
- Vigia::Formatter
- Includes:
- RSpec::Core::Formatters::ConsoleCodes
- Defined in:
- lib/vigia/formatter.rb
Instance Method Summary collapse
- #dump_failures(examples_notification) ⇒ Object
- #example_failed(failed_example_notification) ⇒ Object
- #example_group_finished(example_group_notification) ⇒ Object
- #example_group_started(example_group_notification) ⇒ Object
- #example_passed(example_notification) ⇒ Object
- #example_pending(example_notification) ⇒ Object
-
#initialize(output) ⇒ Formatter
constructor
A new instance of Formatter.
- #start(start_notification) ⇒ Object
Constructor Details
#initialize(output) ⇒ Formatter
Returns a new instance of Formatter.
11 12 13 14 15 16 |
# File 'lib/vigia/formatter.rb', line 11 def initialize(output) super @example_collection = {} @group_level = 0 @verbose = false end |
Instance Method Details
#dump_failures(examples_notification) ⇒ Object
42 43 44 45 |
# File 'lib/vigia/formatter.rb', line 42 def dump_failures(examples_notification) @examples_notification = examples_notification print_context_failures end |
#example_failed(failed_example_notification) ⇒ Object
38 39 40 |
# File 'lib/vigia/formatter.rb', line 38 def example_failed(failed_example_notification) output_example_result(failed_example_notification, :failed) end |
#example_group_finished(example_group_notification) ⇒ Object
26 27 28 |
# File 'lib/vigia/formatter.rb', line 26 def example_group_finished(example_group_notification) @group_level -= 1 end |
#example_group_started(example_group_notification) ⇒ Object
22 23 24 |
# File 'lib/vigia/formatter.rb', line 22 def example_group_started(example_group_notification) @group_level += 1 end |
#example_passed(example_notification) ⇒ Object
34 35 36 |
# File 'lib/vigia/formatter.rb', line 34 def example_passed(example_notification) output_example_result(example_notification, :success) end |
#example_pending(example_notification) ⇒ Object
30 31 32 |
# File 'lib/vigia/formatter.rb', line 30 def example_pending(example_notification) output_example_result(example_notification, :pending) end |
#start(start_notification) ⇒ Object
18 19 20 |
# File 'lib/vigia/formatter.rb', line 18 def start(start_notification) output.puts 'Starting Vigia::RSpec' end |