spec/flipper/feature_spec.rb in flipper-0.1.1 vs spec/flipper/feature_spec.rb in flipper-0.2.0
- old
+ new
@@ -1,11 +1,11 @@
require 'helper'
require 'flipper/feature'
require 'flipper/adapters/memory'
describe Flipper::Feature do
- subject { Flipper::Feature.new(:search, adapter) }
+ subject { described_class.new(:search, adapter) }
let(:source) { {} }
let(:adapter) { Flipper::Adapters::Memory.new(source) }
let(:actor_key) { Flipper::Gates::Actor::Key }
@@ -31,23 +31,12 @@
Flipper.register(:admins) { |thing| thing.admin? }
Flipper.register(:devs) { |thing| thing.dev? }
end
it "initializes with name and adapter" do
- feature = Flipper::Feature.new(:search, adapter)
- feature.should be_instance_of(Flipper::Feature)
- end
-
- describe "#name" do
- it "returns name" do
- subject.name.should eq(:search)
- end
- end
-
- describe "#adapter" do
- it "returns adapter" do
- subject.adapter.should eq(adapter)
- end
+ feature = described_class.new(:search, adapter)
+ feature.name.should eq(:search)
+ feature.adapter.should eq(Flipper::Adapter.wrap(adapter))
end
describe "#enable" do
context "with no arguments" do
before do