# File lib/heckle.rb, line 811 def diff(original, mutation) length = [original.split(%r\n/).size, mutation.split(%r\n/).size].max Tempfile.open("orig") do |a| a.puts(original) a.flush Tempfile.open("fail") do |b| b.puts(mutation) b.flush diff_flags = " " output = %x#{Heckle::DIFF} -U #{length} --label original #{a.path} --label mutation #{b.path}` puts output.sub(%r^@@.*?\n/, '') puts end end end
# File lib/heckle.rb, line 831 def failure(original, failure) self.diff original, failure end
# File lib/heckle.rb, line 798 def info(message) puts "*"*70 puts "*** #{message}" puts "*"*70 puts end
# File lib/heckle.rb, line 783 def method_loaded(klass_name, method_name, mutations_left) info "#{klass_name}\##{method_name} loaded with #{mutations_left} possible mutations" end
# File lib/heckle.rb, line 805 def no_failures puts puts "The following mutations didn't cause test failures:" puts end
# File lib/heckle.rb, line 779 def no_mutations(method_name) warning "#{method_name} has a thick skin. There's nothing to heckle." end
# File lib/heckle.rb, line 835 def no_surviving_mutants puts "No mutants survived. Cool!\n\n" end
# File lib/heckle.rb, line 787 def remaining_mutations(mutations_left) puts "#{mutations_left} mutations remaining..." end
# File lib/heckle.rb, line 839 def replacing(klass_name, method_name, original, src) puts "Replacing #{klass_name}##{method_name} with:\n\n" diff(original, src) end
# File lib/heckle.rb, line 844 def report_test_failures puts "Tests failed -- this is good" if Heckle.debug end
# File lib/heckle.rb, line 791 def warning(message) puts "!" * 70 puts "!!! #{message}" puts "!" * 70 puts end