Class: RSpec::Core::Formatters::BaseFormatter
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/base_formatter.rb
Overview
RSpec’s built-in formatters are all subclasses of RSpec::Core::Formatters::BaseFormatter.
Direct Known Subclasses
BaseTextFormatter, FailureListFormatter, HtmlFormatter, JsonFormatter
Instance Attribute Summary collapse
-
#example_group ⇒ Object
Returns the value of attribute example_group.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #close(_notification) ⇒ Object
- #example_group_started(notification) ⇒ Object
-
#initialize(output) ⇒ BaseFormatter
constructor
A new instance of BaseFormatter.
- #start(notification) ⇒ Object
Constructor Details
#initialize(output) ⇒ BaseFormatter
Returns a new instance of BaseFormatter.
23 24 25 26 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/base_formatter.rb', line 23 def initialize(output) @output = output || StringIO.new @example_group = nil end |
Instance Attribute Details
#example_group ⇒ Object
Returns the value of attribute example_group.
17 18 19 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/base_formatter.rb', line 17 def example_group @example_group end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
18 19 20 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/base_formatter.rb', line 18 def output @output end |
Instance Method Details
#close(_notification) ⇒ Object
50 51 52 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/base_formatter.rb', line 50 def close(_notification) restore_sync_output end |
#example_group_started(notification) ⇒ Object
42 43 44 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/base_formatter.rb', line 42 def example_group_started(notification) @example_group = notification.group end |
#start(notification) ⇒ Object
32 33 34 35 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/formatters/base_formatter.rb', line 32 def start(notification) start_sync_output @example_count = notification.count end |