Sha256: 2b3594b696a64bcd9100040a1d502c4260e18a3f3be217c2e59d475e6263a9c0
Contents?: true
Size: 1.4 KB
Versions: 3
Compression:
Stored size: 1.4 KB
Contents
describe FlipFab do let(:name) { :example_feature } it 'runs the feature' do feature end step 'I define a feature that is :enabled_or_disabled' do |enabled_or_disabled| described_class.define_feature name, { default: enabled_or_disabled.to_sym } end step 'the feature is :enabled_or_disabled' do |enabled_or_disabled| expect(described_class.features[name].enabled?).to eq(enabled_or_disabled == 'enabled') end it 'initializes features' do expect(described_class.features).to be_a FlipFab::FeaturesByName end context '.define_feature' do subject{ described_class.define_feature name } after{ described_class.features.clear } it 'returns the feature' do expect(subject).to be_a FlipFab::Feature expect(subject.name).to eq(:example_feature) end context 'when the feature exists' do it 'overwrites the existing feature' do existing_feature = described_class.define_feature name expect{ subject }.not_to change{ described_class.features.count }.from(1) expect(subject).not_to eq(existing_feature) end end context 'when the feature does not exist' do it 'saves the feature' do expect{ subject }.to change{ described_class.features.count }.from(0).to(1) expected_feature = subject expect(described_class.features[:example_feature]).to eq(expected_feature) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
flip_fab-1.0.1 | spec/lib/flip_fab_spec.rb |
flip_fab-1.0.0 | spec/lib/flip_fab_spec.rb |
flip_fab-0.0.1 | spec/lib/flip_fab_spec.rb |