Skip to content

Commit

Permalink
add tests for concatenated function interpolations, adjust rubocop co…
Browse files Browse the repository at this point in the history
…nfig for added tests
  • Loading branch information
tmu-sprd committed Apr 4, 2024
1 parent ca17207 commit 9862f27
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ RSpec/DescribedClass:
# Offense count: 7
# Configuration parameters: CountAsOne.
RSpec/ExampleLength:
Max: 16
Max: 17

# Offense count: 4
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
Expand All @@ -100,7 +100,7 @@ RSpec/FilePath:

# Offense count: 29
RSpec/MultipleExpectations:
Max: 10
Max: 11

# Offense count: 30
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
Expand Down
2 changes: 2 additions & 0 deletions spec/fixtures/hiera/hiera_badkey.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ this_is_ok: 0
this_is_ok::too: 0
th1s_is_ok::two3: 0
:eventhis: 0
this_is_ok::concat_func: "%{lookup('foo')}%{lookup('bar')}"

typical:typo::warning1: true
::notsotypical::warning2: true
Expand All @@ -15,3 +16,4 @@ this_is::warning7:
- "%{lookup('foobar'):3306}"
this_is::warning8:
foo: "%{lookup('foobar'):3306}"
this_is::warning9: "%{lookup('foo'):3306}%{lookup('bar')}"
3 changes: 2 additions & 1 deletion spec/puppet-syntax/hiera_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

it 'returns warnings for invalid keys' do
hiera_yaml = 'hiera_badkey.yaml'
examples = 8
examples = 9
files = fixture_hiera(hiera_yaml)
res = subject.check(files)
(1..examples).each do |n|
Expand All @@ -44,6 +44,7 @@
expect(res[5]).to match('Key :this_is::warning6: string after a function call but before `}` in the value')
expect(res[6]).to match('Key :this_is::warning7: string after a function call but before `}` in the value')
expect(res[7]).to match('Key :this_is::warning8: string after a function call but before `}` in the value')
expect(res[8]).to match('Key :this_is::warning9: string after a function call but before `}` in the value')
end

it 'returns warnings for bad eyaml values' do
Expand Down

0 comments on commit 9862f27

Please sign in to comment.