diff --git a/spec/puppet-lint/plugins/topscope_variable_spec.rb b/spec/puppet-lint/plugins/topscope_variable_spec.rb index 48139a4..baf0b61 100644 --- a/spec/puppet-lint/plugins/topscope_variable_spec.rb +++ b/spec/puppet-lint/plugins/topscope_variable_spec.rb @@ -153,6 +153,16 @@ class foo::blub { PUP end + let(:fixed) do + <<~PUP + class foo::blub { + notify { 'foo': + message => $foo::bar + } + } + PUP + end + it 'detects one problem' do expect(problems).to have(1).problem end @@ -162,13 +172,7 @@ class foo::blub { end it 'removes :: after the $' do - expect(manifest).to eq <<~PUP - class foo::blub { - notify { 'foo': - message => $foo::bar - } - } - PUP + expect(manifest).to eq fixed end end @@ -183,6 +187,16 @@ class profile::foo { PUP end + let(:fixed) do + <<~PUP + class profile::foo { + notify { 'foo': + message => $some_component_module::bar + } + } + PUP + end + it 'detects one problem' do expect(problems).to have(1).problem end @@ -192,13 +206,7 @@ class profile::foo { end it 'removes :: after the $' do - expect(manifest).to eq <<~PUP - class profile::foo { - notify { 'foo': - message => $some_component_module::bar - } - } - PUP + expect(manifest).to eq fixed end end @@ -213,6 +221,16 @@ class foo::blub { PUP end + let(:fixed) do + <<~PUP + class foo::blub { + notify { 'foo': + message => ">${foo::bar}<" + } + } + PUP + end + it 'detects one problem' do expect(problems).to have(1).problem end @@ -222,13 +240,7 @@ class foo::blub { end it 'removes :: after the $' do - expect(manifest).to eq <<~PUP - class foo::blub { - notify { 'foo': - message => ">${foo::bar}<" - } - } - PUP + expect(manifest).to eq fixed end end end