Sha256: 69adba258e28f98f194baeb199e51880a3b2dfc4a627a0d412f97480aa7b2bef

Contents?: true

Size: 697 Bytes

Versions: 1

Compression:

Stored size: 697 Bytes

Contents

require 'spec_helper'

describe 'ghostbuster_defines' do

  context 'with fix disabled' do

    context 'when define is used' do
      let(:code) { "define foo {}" }
      let(:path) { "./modules/foo/manifests/init.pp" }

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

    context 'when define is not used' do
      let(:code) { "define bar {}" }
      let(:path) { "./modules/bar/manifests/init.pp" }

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
puppet-ghostbuster-0.7.0 spec/puppet-lint/plugins/ghostbuster_defines_spec.rb