Sha256: 7ae77473be791fac0cb0a599f83e16ff811c89cadc4607327d79486669835763

Contents?: true

Size: 592 Bytes

Versions: 9

Compression:

Stored size: 592 Bytes

Contents

RSpec::Support.require_rspec_core('formatters/json_formatter')

# based on https://github.com/rspec/rspec-core/blob/master/lib/rspec/core/formatters/json_formatter.rb
module KnapsackPro
  module Formatters
    class RSpecJsonFormatter < RSpec::Core::Formatters::JsonFormatter
      RSpec::Core::Formatters.register self

      private

      # add example.id to json report to support < RSpec 3.6.0
      # based on https://github.com/rspec/rspec-core/pull/2369/files
      def format_example(example)
        super.merge({
          :id => example.id,
        })
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
knapsack_pro-2.1.0 lib/knapsack_pro/formatters/rspec_json_formatter.rb
knapsack_pro-2.0.0 lib/knapsack_pro/formatters/rspec_json_formatter.rb
knapsack_pro-1.22.3 lib/knapsack_pro/formatters/rspec_json_formatter.rb
knapsack_pro-1.22.2 lib/knapsack_pro/formatters/rspec_json_formatter.rb
knapsack_pro-1.22.1 lib/knapsack_pro/formatters/rspec_json_formatter.rb
knapsack_pro-1.22.0 lib/knapsack_pro/formatters/rspec_json_formatter.rb
knapsack_pro-1.21.0 lib/knapsack_pro/formatters/rspec_json_formatter.rb
knapsack_pro-1.20.2 lib/knapsack_pro/formatters/rspec_json_formatter.rb
knapsack_pro-1.20.1 lib/knapsack_pro/formatters/rspec_json_formatter.rb