diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2016-03-24 14:18:03 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2016-03-24 14:18:03 -0300 |
commit | 309d5859d9c801218075789fe068869ab49065f5 (patch) | |
tree | dc31d7e0e39b48f75475f374d5301bba10c7c64a /spec/classes/samba__server__service_spec.rb | |
parent | 846ed365f19187b50f9aff0c7911b533880398a7 (diff) | |
parent | eb97a2b642499fde7afdb64dfd3e2b7e8c14eacc (diff) | |
download | puppet-samba-309d5859d9c801218075789fe068869ab49065f5.tar.gz puppet-samba-309d5859d9c801218075789fe068869ab49065f5.tar.bz2 |
Merge branch 'master' of https://github.com/ajjahn/puppet-samba
Conflicts:
manifests/server/service.pp
Diffstat (limited to 'spec/classes/samba__server__service_spec.rb')
-rw-r--r-- | spec/classes/samba__server__service_spec.rb | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/spec/classes/samba__server__service_spec.rb b/spec/classes/samba__server__service_spec.rb new file mode 100644 index 0000000..4352ec2 --- /dev/null +++ b/spec/classes/samba__server__service_spec.rb @@ -0,0 +1,54 @@ +require 'spec_helper' + +describe 'samba::server::service' do + context 'on a Debian os family' do + let(:facts) {{ :osfamily => 'Debian' }} + + it { should contain_service('samba').with_require('Class[Samba::Server::Config]') } + + context 'Debian' do + context 'wheezy' do + let(:facts) {{ :osfamily => 'Debian', + :operatingsystem => 'Debian', + :operatingsystemmajrelease => '7' }} + it { should contain_service('samba') } + end + context 'jessie' do + let(:facts) {{ :osfamily => 'Debian', + :operatingsystem => 'Debian', + :operatingsystemmajrelease => '8' }} + it { should contain_service('smbd') } + end + end + + context 'Ubuntu' do + let(:facts) {{ :osfamily => 'Debian', :operatingsystem => 'Ubuntu' }} + it { should contain_service('smbd') } + end + end + + context 'on a Redhat os family' do + let(:facts) {{ :osfamily => 'Redhat' }} + it { should contain_service('smb') } + end + + context 'on a Archlinux os family' do + let(:facts) {{ :osfamily => 'Archlinux' }} + it { should contain_service('smbd') } + end + + context 'on Linux os family' do + let(:facts) {{ :osfamily => 'Linux' }} + it { should raise_error(/is not supported by this module./) } + + context 'Gentoo' do + let(:facts) {{ :osfamily => 'Linux', :operatingsystem => 'Gentoo' }} + it { should contain_service('samba') } + end + end + + context 'on an unsupported OS' do + let(:facts) {{ :osfamily => 'Solaris' }} + it { should raise_error(/Solaris is not supported by this module./) } + end +end |