Sha256: a0771e08338fa00d5dc7328a20630c849b3940cdc8ffce798987f96f3c7b7cdf

Contents?: true

Size: 723 Bytes

Versions: 21

Compression:

Stored size: 723 Bytes

Contents

# frozen_string_literal: true

module CrudeMutant
  class RunResult
    attr_reader :file_path, :line_number, :success, :line_contents

    def initialize(file_path, line_number, success, line_contents, benchmark)
      @file_path = file_path
      @line_number = line_number
      @success = success
      @line_contents = line_contents
      @benchmark = benchmark
    end

    def success?
      success
    end

    def time_taken
      @benchmark.real
    end
  end

  class NullRunResult
    attr_reader :line_number

    def initialize(line_number)
      @line_number = line_number
    end

    def success?
      false
    end

    def time_taken
      0.0
    end

    def line_contents
      ''
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
crude-mutant-0.1.0 lib/crude_mutant/run_result.rb