lib/mutant/reporter/cli/printer.rb in mutant-0.7.3 vs lib/mutant/reporter/cli/printer.rb in mutant-0.7.4

- old
+ new

@@ -135,20 +135,20 @@ alias_method :color?, :tty? # Printer for runner status class Status < self - delegate(:active_jobs, :env_result) + delegate(:active_jobs, :payload) # Print progress for collector # # @return [self] # # @api private # def run - visit(EnvProgress, object.env_result) + visit(EnvProgress, payload) info('Active subjects: %d', active_subject_results.length) visit_collection(SubjectProgress, active_subject_results) job_status self end @@ -162,25 +162,26 @@ # @api private # def job_status return if active_jobs.empty? info('Active Jobs:') - object.active_jobs.sort_by(&:index).each do |job| - info('%d: %s', job.index, job.mutation.identification) + active_jobs.sort_by(&:index).each do |job| + info('%d: %s', job.index, job.payload.identification) end end # Return active subject results # # @return [Array<Result::Subject>] # # @api private # def active_subject_results - active_subjects = active_jobs.map(&:mutation).flat_map(&:subject).to_set + active_mutation_jobs = active_jobs.select { |job| job.payload.kind_of?(Mutant::Mutation) } + active_subjects = active_mutation_jobs.map(&:payload).flat_map(&:subject).to_set - env_result.subject_results.select do |subject_result| + payload.subject_results.select do |subject_result| active_subjects.include?(subject_result.subject) end end end # Status @@ -194,10 +195,12 @@ # # @return [self] # # @api private # + # rubocop:disable AbcSize + # def run info 'Mutant configuration:' info 'Matcher: %s', object.matcher_config.inspect info 'Integration: %s', object.integration.name info 'Expect Coverage: %0.2f%%', object.expected_coverage.inspect @@ -228,10 +231,12 @@ # # @return [self] # # @api private # + # rubocop:disable MethodLength + # def run visit(Config, env.config) info 'Subjects: %s', amount_subjects info 'Mutations: %s', amount_mutations info 'Kills: %s', amount_mutations_killed @@ -383,11 +388,11 @@ # @return [Result::Env] # # @api private # def object - super().env_result + super().payload end end # Reporter for subject progress class SubjectProgress < self @@ -477,10 +482,11 @@ # Reporter for mutation results class MutationResult < self delegate :mutation, :test_result - DIFF_ERROR_MESSAGE = 'BUG: Mutation NOT resulted in exactly one diff hunk. Please report a reproduction!'.freeze + DIFF_ERROR_MESSAGE = + 'BUG: Mutation NOT resulted in exactly one diff hunk. Please report a reproduction!'.freeze MAP = { Mutant::Mutation::Evil => :evil_details, Mutant::Mutation::Neutral => :neutral_details, Mutant::Mutation::Noop => :noop_details