Sha256: 936cfcdd1c0e65732b2b03db53afa14a88ec94facadfa87b5bfc8b06f04f0e8d

Contents?: true

Size: 643 Bytes

Versions: 8

Compression:

Stored size: 643 Bytes

Contents

module Mutant
  class Reporter
    # Reporter to trace report calls, used as a spec adapter
    class Trace
      include Adamantium::Mutable, Anima.new(:start_calls, :progress_calls, :report_calls, :warn_calls)

      # Return new trace reporter
      #
      # @return [Trace]
      #
      # @api private
      #
      def self.new
        super(Hash[anima.attribute_names.map { |name| [name, []] }])
      end

      %w[start progress report warn].each do |name|
        define_method(name) do |object|
          public_send(:"#{name}_calls") << object
          self
        end
      end

    end # Tracker
  end # reporter
end # Mutant

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mutant-0.7.1 lib/mutant/reporter/trace.rb
mutant-0.6.7 lib/mutant/reporter/trace.rb
mutant-0.6.6 lib/mutant/reporter/trace.rb
mutant-0.6.5 lib/mutant/reporter/trace.rb
mutant-0.6.4 lib/mutant/reporter/trace.rb
mutant-0.6.3 lib/mutant/reporter/trace.rb
mutant-0.6.2 lib/mutant/reporter/trace.rb
mutant-0.6.0 lib/mutant/reporter/trace.rb