spec/flipper/dsl_spec.rb in flipper-0.1.1 vs spec/flipper/dsl_spec.rb in flipper-0.2.0

- old
+ new

@@ -11,10 +11,16 @@ def feature(name) Flipper::Feature.new(name, adapter) end + it "wraps adapter when initializing" do + dsl = described_class.new(adapter) + dsl.adapter.should be_instance_of(Flipper::Adapter) + dsl.adapter.adapter.should eq(adapter) + end + describe "#enabled?" do before do subject.stub(:feature => admins_feature) end @@ -62,11 +68,11 @@ end it "returns instance of feature with correct name and adapter" do @result.should be_instance_of(Flipper::Feature) @result.name.should eq(:stats) - @result.adapter.should eq(adapter) + @result.adapter.should eq(subject.adapter) end it "memoizes the feature" do subject.feature(:stats).should equal(@result) end @@ -78,10 +84,10 @@ end it "returns instance of feature with correct name and adapter" do @result.should be_instance_of(Flipper::Feature) @result.name.should eq(:stats) - @result.adapter.should eq(adapter) + @result.adapter.should eq(subject.adapter) end it "memoizes the feature" do subject[:stats].should equal(@result) end