-
-
Notifications
You must be signed in to change notification settings - Fork 143
/
Copy pathjira_service_spec.rb
55 lines (49 loc) · 1.65 KB
/
jira_service_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
require 'spec_helper.rb'
describe 'jira' do
describe 'jira::service' do
context 'supported operating systems' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts
end
let(:params) do
{ javahome: '/opt/java' }
end
let(:pre_condition) do
'package { "jdk": }'
end
context 'with defaults for all parameters' do
it { is_expected.to compile.with_all_deps }
it do
is_expected.to contain_file('/etc/systemd/system/jira.service').
with_content(%r{Atlassian Systemd Jira Service})
end
it { is_expected.to contain_service('jira') }
end
context 'with service_manage set to false' do
let(:params) do
super().merge(service_manage: false)
end
it { is_expected.not_to contain_service('jira') }
end
context 'with service_ensure set to stopped' do
let(:params) do
super().merge(
service_ensure: 'stopped',
service_enable: false,
service_subscribe: 'Package[jdk]'
)
end
it do
is_expected.to contain_service('jira').with('ensure' => 'stopped',
'enable' => 'false',
'notify' => nil,
'subscribe' => 'Package[jdk]')
end
end
end
end
end
end
end