summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/classes/munin_client_spec.rb47
-rw-r--r--spec/spec.opts1
-rw-r--r--spec/spec_helper_system.rb1
3 files changed, 42 insertions, 7 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
diff --git a/spec/spec.opts b/spec/spec.opts
deleted file mode 100644
index d1bd681..0000000
--- a/spec/spec.opts
+++ /dev/null
@@ -1 +0,0 @@
---format documentation --colour --backtrace
diff --git a/spec/spec_helper_system.rb b/spec/spec_helper_system.rb
index 462d2a1..9adfea9 100644
--- a/spec/spec_helper_system.rb
+++ b/spec/spec_helper_system.rb
@@ -22,5 +22,6 @@ RSpec.configure do |c|
# Install modules and dependencies
puppet_module_install(:source => proj_root, :module_name => 'munin')
shell('puppet module install puppetlabs-stdlib')
+ shell('puppet module install puppetlabs-concat')
end
end