From 7be20b4d90918dce2404d5957fc6a2b77e082caf Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Sun, 13 Oct 2013 20:30:33 +0200 Subject: munin host specs --- spec/classes/munin_client_spec.rb | 1 - spec/classes/munin_host_spec.rb | 26 +++++++++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/spec/classes/munin_client_spec.rb b/spec/classes/munin_client_spec.rb index ebf8d73..9a92cef 100644 --- a/spec/classes/munin_client_spec.rb +++ b/spec/classes/munin_client_spec.rb @@ -18,7 +18,6 @@ describe 'munin::client' do :operatingsystem => os, :osfamily => 'RedHat', :lsbdistcodename => codename, - :interfaces => 'lo,eth0', }} it { should contain_package('munin-node') } it { should contain_file('/etc/munin/munin-node.conf') } diff --git a/spec/classes/munin_host_spec.rb b/spec/classes/munin_host_spec.rb index ccfcee6..461ced5 100644 --- a/spec/classes/munin_host_spec.rb +++ b/spec/classes/munin_host_spec.rb @@ -10,12 +10,28 @@ describe 'munin::host' do }} 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', 'Debian', 'wheezy' -# it_behaves_like 'debian', 'Ubuntu', 'precise' -# 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 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 -- cgit v1.2.3