Sha256: 84cdb3dba6a96c62f80fce723945aed1009e44102b0d0bbc530ed18faee73701

Contents?: true

Size: 901 Bytes

Versions: 1

Compression:

Stored size: 901 Bytes

Contents

require 'spec_helper'
require 'feature/config'

describe Feature::Config do
  subject { described_class.new(Proc.new {}) }

  describe "#feature" do
    it "doesn't allow two features with the same name" do
      expect do
        subject.feature :foo, default: :on
        subject.feature :foo, default: :off
      end.to raise_error
    end

    it "adds features to the feature definitions list" do
      subject.feature :foo, default: :on
      subject.features.should include :foo
    end

    it "defaults 'default' to true" do
      subject.feature :foo
      subject.features[:foo][:default].should be_true
    end

    it "accepts definitions with no options" do
      expect { subject.feature :foo }.to_not raise_error
    end

    it "sets backend_obj to the given backend" do
      backend = stub
      subject.backend backend
      subject.backend_obj.should == backend
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gc_feature-0.1.0 spec/feature/config_spec.rb