Class: Heckle::Reporter

### Home Classes Methods

### In Files

- lib/heckle.rb

### Parent

Object

### Methods

- #diff
- #failure
- #info
- #method_loaded
- #no_failures
- #no_mutations
- #no_surviving_mutants
- #remaining_mutations
- #replacing
- #report_test_failures
- #warning

### Files

- History.txt
- Manifest.txt
- README.txt

### Class/Module Index

Quicksearch

- Heckle
- Heckle::Reporter
- Heckle::Timeout
- Autotest
- Autotest::Heckle
- TestUnitHeckler

No matching classes.

# Heckle::Reporter

### Public Instance Methods

diff(original, mutation) click to toggle source

    # File lib/heckle.rb, line 705
    def diff(original, mutation)
      length = [original.split(/\n/).size, mutation.split(/\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 = `#{Heckle::DIFF} -U #{length} --label original #{a.path} --label mutation #{b.path}`
          puts output.sub(/^@@.*?\n/, '')
          puts
        end
      end
    end

failure(original, failure) click to toggle source

    # File lib/heckle.rb, line 725
    def failure(original, failure)
      self.diff original, failure
    end

info(message) click to toggle source

    # File lib/heckle.rb, line 692
    def info(message)
      puts "*"*70
      puts "***  #{message}"
      puts "*"*70
      puts
    end

method_loaded(klass_name, method_name, mutations_left) click to toggle source

    # File lib/heckle.rb, line 677
    def method_loaded(klass_name, method_name, mutations_left)
      info "#{klass_name}\##{method_name} loaded with #{mutations_left} possible mutations"
    end

no_failures() click to toggle source

    # File lib/heckle.rb, line 699
    def no_failures
      puts
      puts "The following mutations didn't cause test failures:"
      puts
    end

no_mutations(method_name) click to toggle source

    # File lib/heckle.rb, line 673
    def no_mutations(method_name)
      warning "#{method_name} has a thick skin. There's nothing to heckle."
    end

no_surviving_mutants() click to toggle source

    # File lib/heckle.rb, line 729
    def no_surviving_mutants
      puts "No mutants survived. Cool!\n\n"
    end

remaining_mutations(mutations_left) click to toggle source

    # File lib/heckle.rb, line 681
    def remaining_mutations(mutations_left)
      puts "#{mutations_left} mutations remaining..."
    end

replacing(klass_name, method_name, original, src) click to toggle source

    # File lib/heckle.rb, line 733
    def replacing(klass_name, method_name, original, src)
      puts "Replacing #{klass_name}##{method_name} with:\n\n"
      diff(original, src)
    end

report_test_failures() click to toggle source

    # File lib/heckle.rb, line 738
    def report_test_failures
      puts "Tests failed -- this is good" if Heckle.debug
    end

warning(message) click to toggle source

    # File lib/heckle.rb, line 685
    def warning(message)
      puts "!" * 70
      puts "!!! #{message}"
      puts "!" * 70
      puts
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.