2014-05-12 09:48:15 -04:00
|
|
|
module Mutant
|
|
|
|
class Reporter
|
|
|
|
# Reporter to trace report calls, used as a spec adapter
|
|
|
|
class Trace
|
|
|
|
include Concord::Public.new(:progress_calls, :report_calls)
|
|
|
|
|
|
|
|
# Return new trace reporter
|
|
|
|
#
|
|
|
|
# @return [Tracer]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def self.new
|
|
|
|
super([], [])
|
|
|
|
end
|
|
|
|
|
|
|
|
# Report object
|
|
|
|
#
|
|
|
|
# @param [Object] object
|
|
|
|
#
|
|
|
|
# @return [self]
|
|
|
|
#
|
2014-06-28 16:52:47 -04:00
|
|
|
# @api private
|
|
|
|
#
|
2014-05-12 09:48:15 -04:00
|
|
|
def report(object)
|
|
|
|
report_calls << object
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
# Report new progress on object
|
|
|
|
#
|
|
|
|
# @param [Object] object
|
|
|
|
#
|
|
|
|
# @return [self]
|
|
|
|
#
|
2014-06-28 16:52:47 -04:00
|
|
|
# @api private
|
|
|
|
#
|
2014-05-12 09:48:15 -04:00
|
|
|
def progress(object)
|
|
|
|
progress_calls << object
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
end # Tracker
|
|
|
|
end # reporter
|
|
|
|
end # Mutant
|