Method: Chaser#validate

Defined in:
lib/chaser.rb

#validateObject

Running the script



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/chaser.rb', line 114

def validate
  @reporter.method_loaded(klass_name, method_name)

  begin
    modify_method
    timeout(@@timeout, Chaser::Timeout) { run_tests }
  rescue Chaser::Timeout
    @reporter.warning "Your tests timed out. Chaser may have caused an infinite loop."
  rescue Interrupt
    @reporter.warning 'Mutation canceled, hit ^C again to exit'
    sleep 2
  end

  unmodify_method # in case we're validating again. we should clean up.

  if @failure
    @reporter.report_failure
    false
  else
    @reporter.no_surviving_mutant
    true
  end
end