spec/lib/pugin/feature/simple_feature_spec.rb in pugin-1.5.1 vs spec/lib/pugin/feature/simple_feature_spec.rb in pugin-1.6.0
- old
+ new
@@ -1,56 +1,17 @@
require 'spec_helper'
-describe 'Pugin simple feature' do
+describe Pugin::Feature::SimpleFeature do
before :example do
Pugin::Feature::SimpleFeature.disable
end
after :example do
Pugin::Feature::SimpleFeature.disable
end
- it 'is initially disabled' do
- expect(Pugin::Feature::SimpleFeature.enabled?).to equal(false)
- end
-
- context 'without being altered' do
- it "returns false when checked if it's enabled" do
- expect(Pugin::Feature::SimpleFeature.enabled?).to equal(false)
- end
- it "returns true when checked if it's disabled" do
- expect(Pugin::Feature::SimpleFeature.disabled?).to equal(true)
- end
- end
-
- context 'when being enabled' do
-
- before :each do
- Pugin::Feature::SimpleFeature.enable
- end
-
- it "returns true when checked if it's enabled" do
- expect(Pugin::Feature::SimpleFeature.enabled?).to equal(true)
- end
- it "returns false when checked if it's disabled" do
- expect(Pugin::Feature::SimpleFeature.disabled?).to equal(false)
- end
- end
-
- context 'when being disabled' do
-
- before :each do
- Pugin::Feature::SimpleFeature.disable
- end
-
- it "returns false when checked if it's enabled" do
- expect(Pugin::Feature::SimpleFeature.enabled?).to equal(false)
- end
- it "returns true when checked if it's disabled" do
- expect(Pugin::Feature::SimpleFeature.disabled?).to equal(true)
- end
- end
+ it_behaves_like 'a simple pugin feature'
context 'when enabling a subclass' do
it 'only enables that sub class' do
expect(Pugin::Feature::SimpleFeature.enabled?).to equal(false)