Sha256: 29097a2301225f7da14e8d23741313221c389248e4eeffe08a2ebf01cc5dbe1d

Contents?: true

Size: 579 Bytes

Versions: 3

Compression:

Stored size: 579 Bytes

Contents

require "test_helper"
require "flipper/test/shared_adapter_test"
require "flipper/adapters/actor_limit"

class Flipper::Adapters::ActorLimitTest < MiniTest::Test
  prepend Flipper::Test::SharedAdapterTests

  def setup
    @memory = Flipper::Adapters::Memory.new
    @adapter = Flipper::Adapters::ActorLimit.new(@memory, 5)
  end

  def test_enable_fails_when_limit_exceeded
    5.times { |i| @feature.enable Flipper::Actor.new("User;#{i}") }

    assert_raises Flipper::Adapters::ActorLimit::LimitExceeded do
      @feature.enable Flipper::Actor.new("User;6")
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flipper-1.3.2 test/adapters/actor_limit_test.rb
flipper-1.3.1 test/adapters/actor_limit_test.rb
flipper-1.3.0 test/adapters/actor_limit_test.rb