Class: RSpec::Core::Formatters::BaseFormatter
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
BaseTextFormatter, RSpec::Core::Formatters::BisectDebugFormatter, RSpec::Core::Formatters::BisectProgressFormatter, RSpec::Core::Formatters::DocumentationFormatter, RSpec::Core::Formatters::FailureListFormatter, RSpec::Core::Formatters::HtmlFormatter, RSpec::Core::Formatters::JsonFormatter, RSpec::Core::Formatters::ProgressFormatter
|
|
Inherits: | Object |
Defined in: | rspec-core/lib/rspec/core/formatters/base_formatter.rb |
Overview
RSpec’s built-in formatters are all subclasses of RSpec::Core::Formatters::BaseFormatter.
Class Method Summary
- .new(output) ⇒ BaseFormatter constructor
Instance Attribute Summary
- #example_group rw
- #output readonly
Instance Method Summary
Constructor Details
.new(output) ⇒ BaseFormatter
Instance Attribute Details
#example_group (rw)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/base_formatter.rb', line 17
attr_accessor :example_group
#output (readonly)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/base_formatter.rb', line 18
attr_reader :output
Instance Method Details
#close(_notification)
# File 'rspec-core/lib/rspec/core/formatters/base_formatter.rb', line 50
def close(_notification) restore_sync_output end
#example_group_started(notification)
# File 'rspec-core/lib/rspec/core/formatters/base_formatter.rb', line 42
def example_group_started(notification) @example_group = notification.group end
#output_supports_sync (private)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/base_formatter.rb', line 64
def output_supports_sync output.respond_to?(:sync=) end
#restore_sync_output (private)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/base_formatter.rb', line 60
def restore_sync_output output.sync = @old_sync if output_supports_sync && !output.closed? end
#start(notification)
# File 'rspec-core/lib/rspec/core/formatters/base_formatter.rb', line 32
def start(notification) start_sync_output @example_count = notification.count end
#start_sync_output (private)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/base_formatter.rb', line 56
def start_sync_output @old_sync, output.sync = output.sync, true if output_supports_sync end