spec/flipper/feature_spec.rb in flipper-0.11.0 vs spec/flipper/feature_spec.rb in flipper-0.12.0

- old
+ new

@@ -104,10 +104,19 @@ subject.remove expect(adapter.features).to eq(Set.new) end end + describe '#clear' do + it 'clears feature using adapter' do + subject.enable + expect(subject).to be_enabled + subject.clear + expect(subject).not_to be_enabled + end + end + describe '#inspect' do it 'returns easy to read string representation' do string = subject.inspect expect(string).to include('Flipper::Feature') expect(string).to include('name=:search') @@ -229,9 +238,20 @@ event = instrumenter.events.last expect(event).not_to be_nil expect(event.name).to eq('feature_operation.flipper') expect(event.payload[:feature_name]).to eq(:search) expect(event.payload[:operation]).to eq(:remove) + expect(event.payload[:result]).not_to be_nil + end + + it 'is recorded for clear' do + subject.clear + + event = instrumenter.events.last + expect(event).not_to be_nil + expect(event.name).to eq('feature_operation.flipper') + expect(event.payload[:feature_name]).to eq(:search) + expect(event.payload[:operation]).to eq(:clear) expect(event.payload[:result]).not_to be_nil end it 'is recorded for enabled?' do thing = Flipper::Types::Actor.new(Flipper::Actor.new('1'))