Skip to content

Commit

Permalink
Merge pull request #27 from ccin2p3/fix-noc-acceptanc
Browse files Browse the repository at this point in the history
Fix acceptance tests of expected to fail tests
  • Loading branch information
faxm0dem authored Mar 7, 2022
2 parents 9f45463 + 918ad62 commit 2fd66b8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
16 changes: 16 additions & 0 deletions examples/NOK_wrong_version.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
class { 'syslog_ng':
config_file => '/tmp/syslog-ng.conf',
manage_package => false,
syntax_check_before_reloads => true,
user => 'balabit',
group => 'balabit',
manage_init_defaults => false,
}

# Should fail with:
# Error parsing config, syntax error, unexpected LL_ERROR, expecting end of file

syslog_ng::config { 'version':
content => '@version 3.6',
order => '02',
}
4 changes: 3 additions & 1 deletion spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ class { 'syslog_ng':
Dir[File.join(__dir__, '..', '..', 'examples', 'NOK_*.pp')].each do |f|
example = File.basename(f)
context "Example #{example}" do
it { is_expected.to compile.and_raise_error }
it 'applies with errors' do
apply_manifest(File.read(f), expect_failures: true)
end
end
end
end

0 comments on commit 2fd66b8

Please sign in to comment.