Sha256: a68ef72105355a4a807bb825d52315a8e12964c2040f50b4ba37daf31cea1ef8

Contents?: true

Size: 715 Bytes

Versions: 14

Compression:

Stored size: 715 Bytes

Contents

require 'helper'
require 'flipper/instrumenters/memory'

describe Flipper::Instrumenters::Memory do
  describe "#initialize" do
    it "sets events to empty array" do
      instrumenter = described_class.new
      instrumenter.events.should eq([])
    end
  end

  describe "#instrument" do
    it "adds to events" do
      instrumenter = described_class.new
      name         = 'user.signup'
      payload      = {:email => 'john@doe.com'}
      block_result = :yielded

      result = instrumenter.instrument(name, payload) { block_result }
      result.should eq(block_result)

      event = described_class::Event.new(name, payload, block_result)
      instrumenter.events.should eq([event])
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
flipper-0.7.1 spec/flipper/instrumenters/memory_spec.rb
flipper-0.7.0 spec/flipper/instrumenters/memory_spec.rb
flipper-0.7.0.beta6 spec/flipper/instrumenters/memory_spec.rb
flipper-0.7.0.beta5 spec/flipper/instrumenters/memory_spec.rb
flipper-0.7.0.beta4 spec/flipper/instrumenters/memory_spec.rb
flipper-0.7.0.beta3 spec/flipper/instrumenters/memory_spec.rb
flipper-0.7.0.beta2 spec/flipper/instrumenters/memory_spec.rb
flipper-0.7.0.beta1 spec/flipper/instrumenters/memory_spec.rb
flipper-0.6.3 spec/flipper/instrumenters/memory_spec.rb
flipper-0.6.2 spec/flipper/instrumenters/memory_spec.rb
flipper-0.6.1 spec/flipper/instrumenters/memory_spec.rb
flipper-0.6.0 spec/flipper/instrumenters/memory_spec.rb
flipper-0.5.0 spec/flipper/instrumenters/memory_spec.rb
flipper-0.4.0 spec/flipper/instrumenters/memory_spec.rb