Class: Suture::Surgeon::Auditor
- Inherits:
-
Object
- Object
- Suture::Surgeon::Auditor
- 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 18 19 20 21 22 23 24 25 26 27 |
# 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) log_warn <<-MSG.gsub(/^ {10}/,'') Seam #{plan.name.inspect} is set to :call_both the :new and :old code paths, but they did not match. The new result was: ``` #{new_result.inspect} ``` The old result was: ``` #{old_result.inspect} ``` MSG if plan.raise_on_result_mismatch raise Suture::Error::ResultMismatch.new(plan, new_result, old_result) end end new_result end |