diff options
author | Jerome Charaoui <jcharaoui@cmaisonneuve.qc.ca> | 2015-01-20 18:40:04 +0000 |
---|---|---|
committer | Jerome Charaoui <jcharaoui@cmaisonneuve.qc.ca> | 2015-01-20 18:40:04 +0000 |
commit | 23201220bf8b7b63da44747be142face0c98eb09 (patch) | |
tree | c1645f62976281a552963b1309307e0d0b6136f3 /spec/classes/munin_host_spec.rb | |
parent | 7e03247a9e219fe8e57d544957eb06e305e69fc1 (diff) | |
parent | eaa092eb1a8f3ae19551e6e80f84d174211b5208 (diff) |
Merge branch 'merge_immerda' into 'master'
This is my attempt at merging the huge backlog of commits from immerda. I've been pretty verbose about it in redmine so I won't repeat it all here. For details, see:
https://labs.riseup.net/code/issues/4132
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 |