diff options
author | Tomas Barton <barton.tomas@gmail.com> | 2013-10-12 18:29:11 +0200 |
---|---|---|
committer | Tomas Barton <barton.tomas@gmail.com> | 2013-10-12 18:29:11 +0200 |
commit | b729e3903ded13e07501fc9b55766d21de206ae8 (patch) | |
tree | b3a1d8b15171a4b217db1d827eb93813702fc570 /spec/classes/munin_client_spec.rb | |
parent | 9c2c7140876bbe20a9871543ba28b7522acdb213 (diff) |
basic munin::client specs
Diffstat (limited to 'spec/classes/munin_client_spec.rb')
-rw-r--r-- | spec/classes/munin_client_spec.rb | 47 |
1 files changed, 41 insertions, 6 deletions
diff --git a/spec/classes/munin_client_spec.rb b/spec/classes/munin_client_spec.rb index 5438b20..a5539b3 100644 --- a/spec/classes/munin_client_spec.rb +++ b/spec/classes/munin_client_spec.rb @@ -1,14 +1,49 @@ require 'spec_helper' describe 'munin::client' do - let :facts do - { - :operatingsystem => 'CentOS', + shared_examples 'debian' do |os, codename| + let(:facts) {{ + :operatingsystem => os, + :osfamily => 'Debian', + :lsbdistcodename => codename, + }} + it { should contain_package('munin-node') } + it { should contain_package('iproute') } + it { should contain_file('/etc/munin/munin-node.conf') } + end + + shared_examples 'redhat' do |os, codename| + let(:facts) {{ + :operatingsystem => os, + :osfamily => 'RedHat', + :lsbdistcodename => codename, :interfaces => 'lo,eth0', - } + }} + it { should contain_package('munin-node') } + it { should contain_file('/etc/munin/munin-node.conf') } + end + + context 'on debian-like system' do + it_behaves_like 'debian', 'Debian', 'squeeze' + it_behaves_like 'debian', 'Debian', 'wheezy' + it_behaves_like 'debian', 'Ubuntu', 'precise' end - it 'should compile' do - should include_class('munin::client') + context 'on redhat-like system' do + it_behaves_like 'redhat', 'CentOS', '6' + # not supported yet + # it_behaves_like 'redhat', 'RedHat', '6' end + + context 'gentoo' do + let(:facts) {{ + :operatingsystem => 'Gentoo', + :osfamily => 'Gentoo', + :lsbdistcodename => '', + :interfaces => 'lo,eth0', + }} + it { should contain_package('munin-node') } + it { should contain_file('/etc/munin/munin-node.conf') } + end + end |