In Files

Parent

Heckle::Reporter

Public Instance Methods

diff(original, mutation) click to toggle source
     # File lib/heckle.rb, line 705
705:     def diff(original, mutation)
706:       length = [original.split(/\n/).size, mutation.split(/\n/).size].max
707: 
708:       Tempfile.open("orig") do |a|
709:         a.puts(original)
710:         a.flush
711: 
712:         Tempfile.open("fail") do |b|
713:           b.puts(mutation)
714:           b.flush
715: 
716:           diff_flags = " "
717: 
718:           output = `#{Heckle::DIFF} -U #{length} --label original #{a.path} --label mutation #{b.path}`
719:           puts output.sub(/^@@.*?\n/, '')
720:           puts
721:         end
722:       end
723:     end
failure(original, failure) click to toggle source
     # File lib/heckle.rb, line 725
725:     def failure(original, failure)
726:       self.diff original, failure
727:     end
info(message) click to toggle source
     # File lib/heckle.rb, line 692
692:     def info(message)
693:       puts "*"*70
694:       puts "***  #{message}"
695:       puts "*"*70
696:       puts
697:     end
method_loaded(klass_name, method_name, mutations_left) click to toggle source
     # File lib/heckle.rb, line 677
677:     def method_loaded(klass_name, method_name, mutations_left)
678:       info "#{klass_name}\##{method_name} loaded with #{mutations_left} possible mutations"
679:     end
no_failures() click to toggle source
     # File lib/heckle.rb, line 699
699:     def no_failures
700:       puts
701:       puts "The following mutations didn't cause test failures:"
702:       puts
703:     end
no_mutations(method_name) click to toggle source
     # File lib/heckle.rb, line 673
673:     def no_mutations(method_name)
674:       warning "#{method_name} has a thick skin. There's nothing to heckle."
675:     end
no_surviving_mutants() click to toggle source
     # File lib/heckle.rb, line 729
729:     def no_surviving_mutants
730:       puts "No mutants survived. Cool!\n\n"
731:     end
remaining_mutations(mutations_left) click to toggle source
     # File lib/heckle.rb, line 681
681:     def remaining_mutations(mutations_left)
682:       puts "#{mutations_left} mutations remaining..."
683:     end
replacing(klass_name, method_name, original, src) click to toggle source
     # File lib/heckle.rb, line 733
733:     def replacing(klass_name, method_name, original, src)
734:       puts "Replacing #{klass_name}##{method_name} with:\n\n"
735:       diff(original, src)
736:     end
report_test_failures() click to toggle source
     # File lib/heckle.rb, line 738
738:     def report_test_failures
739:       puts "Tests failed -- this is good" if Heckle.debug
740:     end
warning(message) click to toggle source
     # File lib/heckle.rb, line 685
685:     def warning(message)
686:       puts "!" * 70
687:       puts "!!! #{message}"
688:       puts "!" * 70
689:       puts
690:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.