class Mutiny::Mode::Mutate

Public Instance Methods

run() click to toggle source
# File lib/mutiny/mode/mutate.rb, line 4
def run
  report "Mutating..."
  report_mutant_summary
  store_mutants
end

Private Instance Methods

mutant_set() click to toggle source
# File lib/mutiny/mode/mutate.rb, line 24
def mutant_set
  @mutant_set ||= configuration.mutator.mutants_for(environment.subjects)
end
mutant_storage() click to toggle source
# File lib/mutiny/mode/mutate.rb, line 28
def mutant_storage
  @store ||= configuration.mutant_storage
end
report_mutant_summary() click to toggle source
# File lib/mutiny/mode/mutate.rb, line 12
def report_mutant_summary
  report "Generated #{mutant_set.size} mutants:"
  mutant_set.group_by_subject.sort_by { |s, _| s.relative_path }.each do |subject, mutants|
    report "  * #{subject.relative_path} - #{mutants.size} mutants"
  end
end
store_mutants() click to toggle source
# File lib/mutiny/mode/mutate.rb, line 19
def store_mutants
  mutant_storage.save(mutant_set)
  report "Check the '.mutants' directory to browse the generated mutants."
end