Class: RSpec::Core::Formatters::DocumentationFormatter Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
BaseTextFormatter ,
BaseFormatter
|
|
Instance Chain:
self,
BaseTextFormatter ,
BaseFormatter
|
|
Inherits: |
RSpec::Core::Formatters::BaseTextFormatter
|
Defined in: | rspec-core/lib/rspec/core/formatters/documentation_formatter.rb |
Class Method Summary
Instance Attribute Summary
BaseFormatter
- Inherited
Instance Method Summary
- #example_failed(failure) Internal use only
- #example_group_finished(_notification) Internal use only
- #example_group_started(notification) Internal use only
- #example_passed(passed) Internal use only
- #example_pending(pending) Internal use only
- #example_started(_notification) Internal use only
- #message(notification) Internal use only
- #current_indentation(offset = 0) private Internal use only
- #failure_output(example) private Internal use only
- #flush_messages private Internal use only
- #next_failure_index private Internal use only
- #passed_output(example) private Internal use only
- #pending_output(example, message) private Internal use only
BaseTextFormatter
- Inherited
#close | Invoked at the end of a suite run. |
#dump_failures | Dumps detailed information about each example failure. |
#dump_pending, | |
#dump_summary | This method is invoked after the dumping of examples and failures. |
#message | Used by the reporter to send messages to the output stream. |
#seed |
BaseFormatter
- Inherited
Instance Method Details
#current_indentation(offset = 0) (private)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/documentation_formatter.rb', line 96
def current_indentation(offset=0) ' ' * (@group_level + offset) end
#example_failed(failure)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/documentation_formatter.rb', line 50
def example_failed(failure) output.puts failure_output(failure.example) @example_running = false end
#example_group_finished(_notification)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/documentation_formatter.rb', line 31
def example_group_finished(_notification) @group_level -= 1 if @group_level > 0 end
#example_group_started(notification)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/documentation_formatter.rb', line 24
def example_group_started(notification) output.puts if @group_level == 0 output.puts "#{current_indentation}#{notification.group.description.strip}" @group_level += 1 end
#example_passed(passed)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/documentation_formatter.rb', line 35
def example_passed(passed) output.puts passed_output(passed.example) @example_running = false end
#example_pending(pending)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/documentation_formatter.rb', line 42
def example_pending(pending) output.puts pending_output(pending.example, pending.example.execution_result. ) @example_running = false end
#example_started(_notification)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/documentation_formatter.rb', line 20
def example_started(_notification) @example_running = true end
#failure_output(example) (private)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/documentation_formatter.rb', line 85
def failure_output(example) ConsoleCodes.wrap("#{current_indentation}#{example.description.strip} " \ "(FAILED - #{next_failure_index})", :failure) end
#flush_messages (private)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/documentation_formatter.rb', line 67
def @messages.each do || output.puts "#{current_indentation(1)}#{}" end @messages.clear end
#message(notification)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/documentation_formatter.rb', line 57
def (notification) if @example_running @messages << notification. else output.puts "#{current_indentation}#{notification.}" end end
#next_failure_index (private)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/documentation_formatter.rb', line 91
def next_failure_index @next_failure_index ||= 0 @next_failure_index += 1 end
#passed_output(example) (private)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/documentation_formatter.rb', line 75
def passed_output(example) ConsoleCodes.wrap("#{current_indentation}#{example.description.strip}", :success) end
#pending_output(example, message) (private)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/documentation_formatter.rb', line 79
def pending_output(example, ) ConsoleCodes.wrap("#{current_indentation}#{example.description.strip} " \ "(PENDING: #{})", :pending) end