aboutsummaryrefslogtreecommitdiff
path: root/spec/classes/samba__server__service_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/classes/samba__server__service_spec.rb')
-rw-r--r--spec/classes/samba__server__service_spec.rb40
1 files changed, 40 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..bc28a9b
--- /dev/null
+++ b/spec/classes/samba__server__service_spec.rb
@@ -0,0 +1,40 @@
+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
+ let(:facts) {{ :osfamily => 'Debian', :operatingsystem => 'Debian' }}
+ it { should contain_service('samba') }
+ 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 a Gentoo os family' do
+ let(:facts) {{ :osfamily => 'Linux', :operatingsystem => 'Gentoo' }}
+ it { should contain_service('samba') }
+ end
+
+ context 'on an unsupported OS' do
+ let(:facts) {{ :osfamily => 'Solaris' }}
+ it { should raise_error(/Solaris is not supported by this module./) }
+ end
+end