Sha256: 1cad16155d769ded3037de594f5ff6f80570eacb05b052634a59633c064b0b91

Contents?: true

Size: 749 Bytes

Versions: 1

Compression:

Stored size: 749 Bytes

Contents

require 'helper'

describe Flipper::Toggles::Set do
  let(:key) { double('Key') }
  let(:adapter) { double('Adapter', :read => '22') }
  let(:gate) { double('Gate', :adapter => adapter, :key => key) }

  subject {
    toggle = described_class.new(gate)
    toggle.stub(:value => Set['bacon']) # implemented in subclass
    toggle
  }

  describe "#enabled?" do
    context "for empty set" do
      before do
        subject.stub(:value => Set.new)
      end

      it "returns false" do
        subject.enabled?.should be_false
      end
    end

    context "for non-empty set" do
      before do
        subject.stub(:value => Set['bacon'])
      end

      it "returns true" do
        subject.enabled?.should be_true
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flipper-0.4.0 spec/flipper/toggles/set_spec.rb