diff options
author | Gabriel Filion <gabster@lelutin.ca> | 2014-12-13 09:34:56 -0500 |
---|---|---|
committer | Gabriel Filion <gabster@lelutin.ca> | 2014-12-13 10:21:25 -0500 |
commit | 48272434978f95c70e34aebe9ce188157f8f935e (patch) | |
tree | 8c940d891cbcba026d56cf8ed2935361debc44fd /spec/classes/munin_host_spec.rb | |
parent | 7e03247a9e219fe8e57d544957eb06e305e69fc1 (diff) | |
parent | 27c9a5dbc2083dcc20d059008702dd3f75382bcc (diff) |
Merge remote-tracking branch 'immerda/master' into merge_immerda
Conflicts:
manifests/plugins/interfaces.pp
$real_ifs was changed on master and we'd like to keep that change
$ifs was changed to use the prefix() function and we'd like to keep that
change.
Diffstat (limited to 'spec/classes/munin_host_spec.rb')
-rw-r--r-- | spec/classes/munin_host_spec.rb | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/spec/classes/munin_host_spec.rb b/spec/classes/munin_host_spec.rb new file mode 100644 index 0000000..df002ce --- /dev/null +++ b/spec/classes/munin_host_spec.rb @@ -0,0 +1,47 @@ +require 'spec_helper' + +describe 'munin::host' do + shared_examples 'debian-host' do |os, codename| + let(:facts) {{ + :operatingsystem => os, + :osfamily => 'Debian', + :lsbdistcodename => codename, + :concat_basedir => '/var/lib/puppet/concat', + }} + it { should contain_package('munin') } + it { should contain_file('/etc/munin/munin.conf') } + it { should contain_class('munin::host') } + end + + shared_examples 'redhat-host' do |os, codename| + let(:facts) {{ + :operatingsystem => os, + :osfamily => 'RedHat', + :lsbdistcodename => codename, + :concat_basedir => '/var/lib/puppet/concat', + }} + it { should contain_package('munin') } + it { should contain_file('/etc/munin/munin.conf') } + it { should contain_class('munin::host') } + end + + context 'on debian-like system' do + it_behaves_like 'debian-host', 'Debian', 'squeeze' + it_behaves_like 'debian-host', 'Debian', 'wheezy' + it_behaves_like 'debian-host', 'Ubuntu', 'precise' + end + + context 'on redhat-like system' do + it_behaves_like 'redhat-host', 'CentOS', '6' + end + + context 'on Gentoo' do + let(:facts) {{ + :osfamily => 'Gentoo', + :concat_basedir => '/var/lib/puppet/concat', + }} + it { should contain_package('munin') } + it { should contain_file('/etc/munin/munin.conf') } + it { should contain_class('munin::host') } + end +end |