Skip to content

Commit

Permalink
Pet rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
smortex committed Sep 4, 2023
1 parent 00a3e17 commit a33f132
Showing 1 changed file with 33 additions and 21 deletions.
54 changes: 33 additions & 21 deletions spec/puppet-lint/plugins/topscope_variable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand All @@ -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

Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a33f132

Please sign in to comment.