Sha256: ec95e281aa35789af82317dff90b5fa4ae5d7ef149fc8132882122b5fdbfd247

Contents?: true

Size: 1.49 KB

Versions: 7

Compression:

Stored size: 1.49 KB

Contents

require 'spec_helper'

describe 'Pugin simple feature' 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
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pugin-1.2.3 spec/lib/pugin/feature/simple_feature_spec.rb
pugin-1.2.2 spec/lib/pugin/feature/simple_feature_spec.rb
pugin-1.2.1 spec/lib/pugin/feature/simple_feature_spec.rb
pugin-1.2.0 spec/lib/pugin/feature/simple_feature_spec.rb
pugin-1.1.2 spec/lib/pugin/feature/simple_feature_spec.rb
pugin-1.0.1.pre spec/lib/pugin/feature/simple_feature_spec.rb
pugin-1.0.1 spec/lib/pugin/feature/simple_feature_spec.rb