Class: Suture::Surgeon::Auditor

Inherits:
Object
  • Object
show all
Includes:
Adapter::Log
Defined in:
lib/suture/surgeon/auditor.rb

Instance Method Summary collapse

Methods included from Adapter::Log

#log_debug, #log_error, #log_info, #log_warn, logger, reset!

Instance Method Details

#operate(plan) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/suture/surgeon/auditor.rb', line 8

def operate(plan)
  scalpel = Suture::Util::Scalpel.new
  new_result = scalpel.cut(plan, :new)
  old_result = scalpel.cut(plan, :old)
  if !plan.comparator.call(old_result, new_result)
    handle_mismatch(plan, old_result, new_result)
  else
    new_result
  end
end