-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathcurrent_spec.rb
49 lines (39 loc) · 2.23 KB
/
current_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
require 'spec_helper'
describe 'access_insights_client::current' do
context 'on 6.10' do
let :facts do
{os: {release: {full: '6.10'}}}
end
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_file('/etc/redhat-access-insights/redhat-access-insights.conf').with_ensure('absent') }
it { is_expected.to contain_file('/etc/cron.daily/redhat-access-insights').with_ensure('absent') }
it { is_expected.to contain_file('/etc/cron.weekly/redhat-access-insights').with_ensure('absent') }
it { is_expected.to contain_package('insights-client') }
it { is_expected.to contain_file('/etc/cron.daily/insights-client').with_ensure('link').with_target('/etc/insights-client/insights-client.cron') }
it { is_expected.to contain_file('/etc/cron.weekly/insights-client').with_ensure('absent') }
it { is_expected.to contain_exec('/usr/bin/insights-client --register') }
it { is_expected.not_to contain_service('insights-client.timer') }
end
context 'on 7.0' do
let :facts do
{os: {release: {full: '7.0'}}}
end
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_file('/etc/redhat-access-insights/redhat-access-insights.conf').with_ensure('absent') }
it { is_expected.to contain_file('/etc/cron.daily/redhat-access-insights').with_ensure('absent') }
it { is_expected.to contain_file('/etc/cron.weekly/redhat-access-insights').with_ensure('absent') }
it { is_expected.to contain_package('insights-client') }
it { is_expected.to contain_file('/etc/insights-client/insights-client.conf').with_ensure('file') }
it { is_expected.to contain_file('/etc/cron.daily/insights-client').with_ensure('absent') }
it { is_expected.to contain_file('/etc/cron.weekly/insights-client').with_ensure('absent') }
it { is_expected.to contain_exec('/usr/bin/insights-client --register') }
it { is_expected.to contain_service('insights-client.timer') }
it { is_expected.to contain_file('/etc/insights-client/tags.yaml').with_content(%r{^--- \{\}$}) }
context 'with tags' do
let :params do
{tags: {'foo': 'bar'}}
end
it { is_expected.to contain_file('/etc/insights-client/tags.yaml').with_content(%r{^---\nfoo: bar$}) }
end
end
end