2014-05-12 13:48:15 +00:00
|
|
|
module Mutant
|
|
|
|
class Reporter
|
|
|
|
# Reporter to trace report calls, used as a spec adapter
|
|
|
|
class Trace
|
2014-07-02 19:23:40 +00:00
|
|
|
include Concord::Public.new(:progress_calls, :report_calls, :warn_calls)
|
2014-05-12 13:48:15 +00:00
|
|
|
|
|
|
|
# Return new trace reporter
|
|
|
|
#
|
|
|
|
# @return [Tracer]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def self.new
|
2014-07-02 19:23:40 +00:00
|
|
|
super([], [], [])
|
|
|
|
end
|
|
|
|
|
|
|
|
# Warn with message
|
|
|
|
#
|
|
|
|
# @param [String] message
|
|
|
|
#
|
|
|
|
# @return [self]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def warn(message)
|
|
|
|
warn_calls << message
|
|
|
|
self
|
2014-05-12 13:48:15 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# Report object
|
|
|
|
#
|
|
|
|
# @param [Object] object
|
|
|
|
#
|
|
|
|
# @return [self]
|
|
|
|
#
|
2014-06-28 20:52:47 +00:00
|
|
|
# @api private
|
|
|
|
#
|
2014-05-12 13:48:15 +00:00
|
|
|
def report(object)
|
|
|
|
report_calls << object
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
# Report new progress on object
|
|
|
|
#
|
|
|
|
# @param [Object] object
|
|
|
|
#
|
|
|
|
# @return [self]
|
|
|
|
#
|
2014-06-28 20:52:47 +00:00
|
|
|
# @api private
|
|
|
|
#
|
2014-05-12 13:48:15 +00:00
|
|
|
def progress(object)
|
|
|
|
progress_calls << object
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
end # Tracker
|
|
|
|
end # reporter
|
|
|
|
end # Mutant
|