require "helper" require "twirl/instrumenters/memory" class MemoryInstrumenterTest < Minitest::Test def test_initialize instrumentor = Twirl::Instrumenters::Memory.new assert_equal [], instrumentor.events end def test_instrument instrumentor = Twirl::Instrumenters::Memory.new name = 'user.signup' payload = {:email => 'john@doe.com'} block_result = :yielded result = instrumentor.instrument(name, payload) { block_result } assert_equal block_result, result event = Twirl::Instrumenters::Memory::Event.new(name, payload, block_result) assert_equal [event], instrumentor.events end end