Sha256: e7130840c27d9d6dd7510309dd0a86deabb3d11a8f2bee89dad9cfc18cd95058

Contents?: true

Size: 646 Bytes

Versions: 1

Compression:

Stored size: 646 Bytes

Contents

module FormatterSupport
  def reporter
    @reporter ||= setup_reporter
  end

  def config
    @configuration ||= begin
      RSpec::Core::Configuration.new.tap do |config|
        config.output_stream = formatter_output
      end
    end
  end

  def formatter
    @formatter ||= begin
      setup_reporter
      @formatter
    end
  end

  def setup_reporter
    config.add_formatter described_class
    @formatter = config.formatters.first
    @reporter = config.reporter
  end

  def setup_profiler
    config.profile_examples = true
    reporter.setup_profiler
  end

  def formatter_output
    @formatter_output ||= StringIO.new
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shouldit-formatters-rspec-0.0.1 spec/support/formatter_support.rb