Sha256: f3c47815a00c120229a31c65d55e9a884ca1bf3a6f780d28fd9f3b9fd8f9c8e3

Contents?: true

Size: 1002 Bytes

Versions: 12

Compression:

Stored size: 1002 Bytes

Contents

RSpec.describe Flipper::Adapters::Memory do
  let(:source) { {} }
  subject { described_class.new(source) }

  it_should_behave_like 'a flipper adapter'

  it "can initialize from big hash" do
    flipper = Flipper.new(subject)
    flipper.enable :subscriptions
    flipper.disable :search
    flipper.enable_percentage_of_actors :pro_deal, 20
    flipper.enable_percentage_of_time :logging, 30
    flipper.enable_actor :following, Flipper::Actor.new('1')
    flipper.enable_actor :following, Flipper::Actor.new('3')
    flipper.enable_group :following, Flipper::Types::Group.new(:staff)

    expect(source).to eq({
      "subscriptions" => subject.default_config.merge(boolean: "true"),
      "search" => subject.default_config,
      "logging" => subject.default_config.merge(:percentage_of_time => "30"),
      "pro_deal" => subject.default_config.merge(:percentage_of_actors => "20"),
      "following" => subject.default_config.merge(actors: Set["1", "3"], groups: Set["staff"]),
    })
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
flipper-0.26.0 spec/flipper/adapters/memory_spec.rb
flipper-0.26.0.rc2 spec/flipper/adapters/memory_spec.rb
flipper-0.26.0.rc1 spec/flipper/adapters/memory_spec.rb
flipper-0.25.4 spec/flipper/adapters/memory_spec.rb
flipper-0.25.3 spec/flipper/adapters/memory_spec.rb
flipper-0.25.2 spec/flipper/adapters/memory_spec.rb
flipper-0.25.1 spec/flipper/adapters/memory_spec.rb
flipper-0.25.0 spec/flipper/adapters/memory_spec.rb
flipper-0.24.1 spec/flipper/adapters/memory_spec.rb
flipper-0.24.0 spec/flipper/adapters/memory_spec.rb
flipper-0.23.1 spec/flipper/adapters/memory_spec.rb
flipper-0.23.0 spec/flipper/adapters/memory_spec.rb