class RSpec::Core::Formatters::BaseFormatter

@see RSpec::Core::Reporter
@see RSpec::Core::Formatters::BaseTextFormatter
only receive those notifications it has registered itself to receive.
interface. The reporter will issue these during a normal test suite run, but a formatter will
but the BaseTextFormatter documents all of the notifications implemented as part of the standard
RSpec’s built-in formatters are all subclasses of RSpec::Core::Formatters::BaseTextFormatter,

def close(notification)

Parameters:
  • notification (NullNotification) --

Other tags:
    Api: - public
def close(notification)
  restore_sync_output
end

def example_group_started(notification)

Parameters:
  • notification (GroupNotification) -- containing example_group subclass of `RSpec::Core::ExampleGroup`

Other tags:
    Api: - public
def example_group_started(notification)
  @example_group = notification.group
end

def initialize(output)

Parameters:
  • output (IO) -- the formatter output

Other tags:
    Api: - public
def initialize(output)
  @output = output || StringIO.new
  @example_group = nil
end

def output_supports_sync

def output_supports_sync
  output.respond_to?(:sync=)
end

def restore_sync_output

def restore_sync_output
  output.sync = @old_sync if output_supports_sync and !output.closed?
end

def start(notification)

Parameters:
  • notification (StartNotification) --

Other tags:
    Api: - public
def start(notification)
  start_sync_output
  @example_count = notification.count
end

def start_sync_output

def start_sync_output
  @old_sync, output.sync = output.sync, true if output_supports_sync
end