-
-
Notifications
You must be signed in to change notification settings - Fork 875
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add acceptance test to verify default values
- Loading branch information
1 parent
1afdad7
commit 1d29b3c
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'nginx class' do | ||
context 'default parameters' do | ||
# Using puppet_apply as a helper | ||
it 'works idempotently with no errors' do | ||
pp = 'include nginx' | ||
|
||
# Run it twice and test for idempotency | ||
apply_manifest(pp, catch_failures: true) | ||
apply_manifest(pp, catch_changes: true) | ||
end | ||
|
||
# do some basic checks | ||
pkg = case fact('os.family') | ||
when 'Archlinux' | ||
'nginx-mainline' | ||
else | ||
'nginx' | ||
end | ||
describe package(pkg) do | ||
it { is_expected.to be_installed } | ||
end | ||
|
||
describe service('nginx') do | ||
it { is_expected.to be_running } | ||
it { is_expected.to be_enabled } | ||
end | ||
|
||
describe port(80) do | ||
it { is_expected.to be_listening } | ||
end | ||
end | ||
end |