diff --git a/lib/puppet-lint/plugins/top_scope_facts/top_scope_facts.rb b/lib/puppet-lint/plugins/top_scope_facts/top_scope_facts.rb old mode 100755 new mode 100644 diff --git a/spec/unit/puppet-lint/plugins/top_scope_facts/top_scope_facts_spec.rb b/spec/unit/puppet-lint/plugins/top_scope_facts/top_scope_facts_spec.rb index 43d477ef..a982a7a2 100644 --- a/spec/unit/puppet-lint/plugins/top_scope_facts/top_scope_facts_spec.rb +++ b/spec/unit/puppet-lint/plugins/top_scope_facts/top_scope_facts_spec.rb @@ -37,26 +37,10 @@ end context 'fact variable using top scope' do - let(:code) { '$::operatingsystem' } + let(:code) { '$::fqdn' } - it 'onlies detect a single problem' do - expect(problems).to have(1).problem - end - - it 'creates a warning' do - expect(problems).to contain_warning(msg).on_line(1).in_column(1) - end - end - - context 'fact variable using top scope with curly braces in double quote' do - let(:code) { '"${::operatingsystem}"' } - - it 'onlies detect a single problem' do - expect(problems).to have(1).problem - end - - it 'creates a warning' do - expect(problems).to contain_warning(msg).on_line(1).in_column(4) + it 'does not detect a single problem' do + expect(problems).to have(0).problem end end @@ -126,34 +110,6 @@ end end - context 'fact variable using top scope' do - let(:code) { '$::operatingsystem' } - - it 'onlies detect a single problem' do - expect(problems).to have(1).problem - end - - it 'fixes the problem' do - expect(problems).to contain_fixed(msg).on_line(1).in_column(1) - end - - it 'shoulds use the facts hash' do - expect(manifest).to eq("$facts['operatingsystem']") - end - end - - context 'fact variable using top scope with curly braces in double quote' do - let(:code) { '"${::operatingsystem}"' } - - it 'fixes the problem' do - expect(problems).to contain_fixed(msg).on_line(1).in_column(4) - end - - it 'shoulds use the facts hash' do - expect(manifest).to eq('"${facts[\'operatingsystem\']}"') - end - end - context 'with custom top scope fact variables' do before(:each) do PuppetLint.configuration.top_scope_variables = ['location', 'role']