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, :message, :dump_summary, :dump_profile, :stop, :seed, :close

      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

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

Remove methods because it's not needed to generate json report and in old rspec 3.6.5 it fails due to lack of seed method
Remove methods because it's not needed to generate json report and in old rspec 3.6.5 it fails due to lack of seed method
