Sha256: 8e0878412bf3c4e8fa989ffe4a6ee609bcf0dbd817bb767cfa403db43431f47c
Contents?: true
Size: 527 Bytes
Versions: 8
Compression:
Stored size: 527 Bytes
Contents
module Cassanity module Instrumenters # Instrumentor that is useful for tests as it stores each of the events that # are instrumented. class Memory Event = Struct.new(:name, :payload, :result) attr_reader :events def initialize @events = [] end def instrument(name, payload = {}) result = if block_given? yield payload else nil end @events << Event.new(name, payload, result) result end end end end
Version data entries
8 entries across 8 versions & 1 rubygems