Sha256: 075523c28d95c317be66d279bd61f78210b1e58266d2ee9c5dab8fba2ada0fbf

Contents?: true

Size: 1.59 KB

Versions: 3

Compression:

Stored size: 1.59 KB

Contents

require "rspec/core"
require "rspec/legacy_formatters/version"
require "rspec/legacy_formatters/adaptor"
require 'stringio'

# Require all of rspec-core's formatters (and supporting files).
# We do this so that if a legacy formatter gem requires any of
# these files, it'll be a no-op (as the file will have already
# been required). If we didn't do this, and one of the rspec-core
# formatters got loaded after our definition here, it could stomp
# our definition.
%w[
  base_formatter
  base_text_formatter
  console_codes
  deprecation_formatter
  documentation_formatter
  helpers
  html_formatter
  html_printer
  json_formatter
  progress_formatter
  snippet_extractor
].each do |formatter_file|
  require "rspec/core/formatters/#{formatter_file}"
end

%w[
  base_formatter
  base_text_formatter
  documentation_formatter
  html_formatter
  json_formatter
  progress_formatter
].each do |formatter|
  require "rspec/legacy_formatters/#{formatter}"
end

# Namespace for the rspec code.
module RSpec
  # Namespace for the rspec-legacy_formatters code.
  module LegacyFormatters

    # Loads legacy formatters into an adaptor.
    #
    # @param formatter_class [Class] a legacy formatter class
    # @param args [Array(IO)] output streams for formatters
    # @return [Adaptor] a legacy formatter adaptor with an initialized legacy formatter
    def self.load_formatter(formatter_class, *args)
      Adaptor.new(formatter_class, *args)
    end

  end

  module Core
    # Needed for Fivemat.
    # See https://github.com/rspec/rspec-core/pull/1129
    PendingExampleFixedError = Pending::PendingExampleFixedError
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
rspec-legacy_formatters-1.0.2 lib/rspec/legacy_formatters.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/rspec-legacy_formatters-1.0.1/lib/rspec/legacy_formatters.rb
rspec-legacy_formatters-1.0.1 lib/rspec/legacy_formatters.rb