Sha256: 9e5476c5da303bf815a5e33fbc691e2242259b8ab955d7f7906a580227a3b677

Contents?: true

Size: 633 Bytes

Versions: 6

Compression:

Stored size: 633 Bytes

Contents

require 'spec_helper'

describe 'ghostbuster_classes' do
  let(:path) { "./modules/foo/manifests/init.pp" }

  context 'with fix disabled' do

    context 'when class is used' do
      let(:code) { "class foo {}" }

      it 'should not detect any problem' do
        expect(problems).to have(0).problems
      end
    end

    context 'when class is not used' do
      let(:code) { "class bar {}" }

      it 'should detect one problem' do
        expect(problems).to have(1).problems
      end

      it 'should create a warning' do
        expect(problems).to contain_warning('Class Bar seems unused')
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
puppet-ghostbuster-0.9.0 spec/puppet-lint/plugins/ghostbuster_classes_spec.rb
puppet-ghostbuster-0.8.0 spec/puppet-lint/plugins/ghostbuster_classes_spec.rb
puppet-ghostbuster-0.7.3 spec/puppet-lint/plugins/ghostbuster_classes_spec.rb
puppet-ghostbuster-0.7.2 spec/puppet-lint/plugins/ghostbuster_classes_spec.rb
puppet-ghostbuster-0.7.1 spec/puppet-lint/plugins/ghostbuster_classes_spec.rb
puppet-ghostbuster-0.7.0 spec/puppet-lint/plugins/ghostbuster_classes_spec.rb