Sha256: 72069631e9e8dd9b746006709c4d4f841831680e42d17fe51408fc8535a05634

Contents?: true

Size: 907 Bytes

Versions: 7

Compression:

Stored size: 907 Bytes

Contents

require 'spec_helper'

describe 'Pugin feature module' do
   context 'when attempting to enable a feature that exists' do

        before :each do 
            Pugin::Feature.enable('StatusBanner')
        end

        it 'should successfully enable the feature' do 
            expect(Pugin::Feature::StatusBanner.enabled?).to equal(true) 
        end    
   end

   context 'when attempting to disable a feature that exists' do 
        before :each do 
            Pugin::Feature.disable('StatusBanner')
        end

        it 'should successfully disable the feature' do 
            expect(Pugin::Feature::StatusBanner.enabled?).to equal(false)
        end
   end

   context "when attempting to enable a feature that doesn't exist" do
        it 'should raise an ArgumentError' do 
            expect {Pugin::Feature.enable('NonExistentFeature')}.to raise_error(ArgumentError)
        end
   end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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