Sha256: 8ee606e05e925a399adf522667379a10326fd783840bd32019db46317ccc0b11

Contents?: true

Size: 585 Bytes

Versions: 3

Compression:

Stored size: 585 Bytes

Contents

require "flipper/adapters/actor_limit"

RSpec.describe Flipper::Adapters::ActorLimit do
  it_should_behave_like 'a flipper adapter' do
    let(:limit) { 5 }
    let(:adapter) { Flipper::Adapters::ActorLimit.new(Flipper::Adapters::Memory.new, limit) }

    subject { adapter }

    describe '#enable' do
      it "fails when limit exceeded" do
        5.times { |i| feature.enable Flipper::Actor.new("User;#{i}") }

        expect {
          feature.enable Flipper::Actor.new("User;6")
        }.to raise_error(Flipper::Adapters::ActorLimit::LimitExceeded)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flipper-1.3.2 spec/flipper/adapters/actor_limit_spec.rb
flipper-1.3.1 spec/flipper/adapters/actor_limit_spec.rb
flipper-1.3.0 spec/flipper/adapters/actor_limit_spec.rb