class RSpec::Core::Formatters::BaseTextFormatter
Base for all of RSpec's built-in formatters. See RSpec::Core::Formatters::BaseFormatter to learn more about all of the methods called by the reporter.
@see RSpec::Core::Formatters::BaseFormatter @see RSpec::Core::Reporter
Public Instance Methods
@api public
Invoked at the very end, `close` allows the formatter to clean up resources, e.g. open streams, etc.
@param _notification [NullNotification] (Ignored)
# File lib/rspec/core/formatters/base_text_formatter.rb, line 65 def close(_notification) return unless IO === output return if output.closed? output.puts output.close unless output == $stdout end
@api public
Dumps detailed information about each example failure.
@param notification [NullNotification]
# File lib/rspec/core/formatters/base_text_formatter.rb, line 31 def dump_failures(notification) return if notification.failure_notifications.empty? output.puts notification.fully_formatted_failed_examples end
@private
# File lib/rspec/core/formatters/base_text_formatter.rb, line 48 def dump_pending(notification) return if notification.pending_examples.empty? output.puts notification.fully_formatted_pending_examples end
@api public
This method is invoked after the dumping of examples and failures. Each parameter is assigned to a corresponding attribute.
@param summary [SummaryNotification] containing duration,
example_count, failure_count and pending_count
# File lib/rspec/core/formatters/base_text_formatter.rb, line 43 def dump_summary(summary) output.puts summary.fully_formatted end
@api public
Used by the reporter to send messages to the output stream.
@param notification [MessageNotification] containing message
# File lib/rspec/core/formatters/base_text_formatter.rb, line 22 def message(notification) output.puts notification.message end
@private
# File lib/rspec/core/formatters/base_text_formatter.rb, line 54 def seed(notification) return unless notification.seed_used? output.puts notification.fully_formatted end