diff options
author | duritong <peter.meier+github@immerda.ch> | 2013-10-13 23:52:12 -0700 |
---|---|---|
committer | duritong <peter.meier+github@immerda.ch> | 2013-10-13 23:52:12 -0700 |
commit | 47ccd6a820aa140a91e9385d3a1a983b85ea7c76 (patch) | |
tree | e0c0eed63c9ec13481713600132dea032d0e66b3 /spec/classes/munin_client_spec.rb | |
parent | 7005c57b8d4f9a460d84c859d2b137b40c900295 (diff) | |
parent | b38f8b003efd9babe298029309c7ace0cc0a7e7c (diff) |
Merge pull request #24 from deric/specs
Integrate automated testing
Diffstat (limited to 'spec/classes/munin_client_spec.rb')
-rw-r--r-- | spec/classes/munin_client_spec.rb | 50 |
1 files changed, 43 insertions, 7 deletions
diff --git a/spec/classes/munin_client_spec.rb b/spec/classes/munin_client_spec.rb index 5438b20..9a92cef 100644 --- a/spec/classes/munin_client_spec.rb +++ b/spec/classes/munin_client_spec.rb @@ -1,14 +1,50 @@ require 'spec_helper' describe 'munin::client' do - let :facts do - { - :operatingsystem => 'CentOS', - :interfaces => 'lo,eth0', - } + shared_examples 'debian-client' 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') } + it { should include_class('munin::client::debian') } + end + + shared_examples 'redhat-client' do |os, codename| + let(:facts) {{ + :operatingsystem => os, + :osfamily => 'RedHat', + :lsbdistcodename => codename, + }} + 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-client', 'Debian', 'squeeze' + it_behaves_like 'debian-client', 'Debian', 'wheezy' + it_behaves_like 'debian-client', 'Ubuntu', 'precise' end - it 'should compile' do - should include_class('munin::client') + context 'on redhat-like system' do + it_behaves_like 'redhat-client', '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') } + it { should include_class('munin::client::gentoo') } + end + end |