Sha256: bf7d6a188b27fbbb312e5ceebc35f814fb825610d9c8826e5913b83c34499119

Contents?: true

Size: 466 Bytes

Versions: 3

Compression:

Stored size: 466 Bytes

Contents

# frozen_string_literal: true

require "json"

module CrudeMutant
  class JsonResultPrinter
    class << self
      def call(result, stream = $stdout)
        stream.print(
          JSON.dump({
            result.file_path => {
              passed_lines: result.run_results.select(&:success?).map(&:line_number),
              failed_lines: result.run_results.select(&:reject?).map(&:line_number),
            }
          }),
        )
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
crude-mutant-0.3.2 lib/crude_mutant/json_result_printer.rb
crude-mutant-0.3.1 lib/crude_mutant/json_result_printer.rb
crude-mutant-0.3.0 lib/crude_mutant/json_result_printer.rb