spec/flipper/dsl_spec.rb in flipper-0.7.5 vs spec/flipper/dsl_spec.rb in flipper-0.8.0

- old
+ new

@@ -24,13 +24,15 @@ it "overrides default instrumenter" do dsl = described_class.new(adapter, :instrumenter => instrumenter) expect(dsl.instrumenter).to be(instrumenter) end - it "passes overridden instrumenter to adapter wrapping" do + it "passes overridden instrumenter to instrumented adapter" do dsl = described_class.new(adapter, :instrumenter => instrumenter) - expect(dsl.adapter.instrumenter).to be(instrumenter) + memoized = dsl.adapter + instrumented = memoized.adapter + expect(instrumented.instrumenter).to be(instrumenter) end end end describe "#feature" do @@ -229,8 +231,18 @@ subject.enable_percentage_of_actors(:stats, 6) expect(subject[:stats].percentage_of_actors_value).to be(6) subject.disable_percentage_of_actors(:stats) expect(subject[:stats].percentage_of_actors_value).to be(0) + end + end + + describe '#remove' do + it "removes the feature" do + subject.enable(:stats) + + expect { subject.remove(:stats) }.to change { subject.enabled?(:stats) }.to(false) + + expect(subject.features).to be_empty end end end