Sha256: 09d3adc36ee6e3be08da18d19bfe7bfe1159f9b39a354739e9a9feaefc59cccd

Contents?: true

Size: 733 Bytes

Versions: 12

Compression:

Stored size: 733 Bytes

Contents

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

RSpec.describe Flipper::Instrumenters::Memory do
  describe "#initialize" do
    it "sets events to empty array" do
      instrumenter = described_class.new
      expect(instrumenter.events).to 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 }
      expect(result).to eq(block_result)

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
flipper-0.10.2 spec/flipper/instrumenters/memory_spec.rb
flipper-0.10.1 spec/flipper/instrumenters/memory_spec.rb
flipper-0.10.0 spec/flipper/instrumenters/memory_spec.rb
flipper-0.9.2 spec/flipper/instrumenters/memory_spec.rb
flipper-0.9.1 spec/flipper/instrumenters/memory_spec.rb
flipper-0.9.0 spec/flipper/instrumenters/memory_spec.rb
flipper-0.9.0.beta1 spec/flipper/instrumenters/memory_spec.rb
flipper-0.8.0 spec/flipper/instrumenters/memory_spec.rb
flipper-0.7.5 spec/flipper/instrumenters/memory_spec.rb
flipper-0.7.4 spec/flipper/instrumenters/memory_spec.rb
flipper-0.7.3 spec/flipper/instrumenters/memory_spec.rb
flipper-0.7.2 spec/flipper/instrumenters/memory_spec.rb