diff options
Diffstat (limited to 'spec/classes/munin_host_spec.rb')
-rw-r--r-- | spec/classes/munin_host_spec.rb | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/spec/classes/munin_host_spec.rb b/spec/classes/munin_host_spec.rb index 2216cc5..461ced5 100644 --- a/spec/classes/munin_host_spec.rb +++ b/spec/classes/munin_host_spec.rb @@ -1,14 +1,37 @@ require 'spec_helper' describe 'munin::host' do - let :facts do - { - :operatingsystem => 'CentOS', - :interfaces => 'lo,eth0', - } + 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 include_class('munin::host') } end - it 'should compile' do - should include_class('munin::host') + 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 include_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 end |