Sha256: 3ff17474031053c0c9c3b7fb061058b7ae7a84aff7304f663caffb471ff4a3df

Contents?: true

Size: 467 Bytes

Versions: 9

Compression:

Stored size: 467 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.reject(&:success?).map(&:line_number),
            }
          }),
        )
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
crude-mutant-0.5.5 lib/crude_mutant/json_result_printer.rb
crude-mutant-0.5.4 lib/crude_mutant/json_result_printer.rb
crude-mutant-0.5.3 lib/crude_mutant/json_result_printer.rb
crude-mutant-0.5.2 lib/crude_mutant/json_result_printer.rb
crude-mutant-0.5.1 lib/crude_mutant/json_result_printer.rb
crude-mutant-0.5.0 lib/crude_mutant/json_result_printer.rb
crude-mutant-0.4.0 lib/crude_mutant/json_result_printer.rb
crude-mutant-0.3.4 lib/crude_mutant/json_result_printer.rb
crude-mutant-0.3.3 lib/crude_mutant/json_result_printer.rb