Sha256: 8699efe9564e7c9e369c7e22346e89a6ad9d8328e1b8fe90f95ad211c5a08ed0

Contents?: true

Size: 732 Bytes

Versions: 39

Compression:

Stored size: 732 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

39 entries across 39 versions & 1 rubygems

Version Path
flipper-0.22.2 spec/flipper/instrumenters/memory_spec.rb
flipper-0.22.1 spec/flipper/instrumenters/memory_spec.rb
flipper-0.22.0 spec/flipper/instrumenters/memory_spec.rb
flipper-0.21.0 spec/flipper/instrumenters/memory_spec.rb
flipper-0.21.0.rc2 spec/flipper/instrumenters/memory_spec.rb
flipper-0.21.0.rc1 spec/flipper/instrumenters/memory_spec.rb
flipper-0.20.4 spec/flipper/instrumenters/memory_spec.rb
flipper-0.20.3 spec/flipper/instrumenters/memory_spec.rb
flipper-0.20.2 spec/flipper/instrumenters/memory_spec.rb
flipper-0.20.1 spec/flipper/instrumenters/memory_spec.rb
flipper-0.20.0 spec/flipper/instrumenters/memory_spec.rb
flipper-0.20.0.beta3 spec/flipper/instrumenters/memory_spec.rb
flipper-0.20.0.beta2 spec/flipper/instrumenters/memory_spec.rb
flipper-0.20.0.beta1 spec/flipper/instrumenters/memory_spec.rb
flipper-0.19.1 spec/flipper/instrumenters/memory_spec.rb
flipper-0.19.0 spec/flipper/instrumenters/memory_spec.rb
flipper-0.18.0 spec/flipper/instrumenters/memory_spec.rb
flipper-0.17.2 spec/flipper/instrumenters/memory_spec.rb
flipper-0.17.1 spec/flipper/instrumenters/memory_spec.rb
flipper-0.16.2 spec/flipper/instrumenters/memory_spec.rb