|
68 | 68 | end |
69 | 69 | else |
70 | 70 | it do |
71 | | - is_expected.to contain_package(package_name).with( |
72 | | - ensure: 'present', |
73 | | - require: 'Class[Zabbix::Repo]', |
74 | | - tag: 'zabbix' |
75 | | - ) |
| 71 | + is_expected.to contain_package(package_name). |
| 72 | + with_ensure('present'). |
| 73 | + with_tag('zabbix'). |
| 74 | + that_requires('Class[zabbix::repo]') |
76 | 75 | end |
77 | 76 | it do |
78 | | - is_expected.to contain_service(service_name).with( |
79 | | - ensure: 'running', |
80 | | - enable: true, |
81 | | - hasstatus: true, |
82 | | - hasrestart: true, |
83 | | - require: "Package[#{package_name}]" |
84 | | - ) |
| 77 | + is_expected.to contain_service(service_name). |
| 78 | + with_ensure('running'). |
| 79 | + with_enable(true). |
| 80 | + with_service_provider(facts[:osfamily] == 'AIX' ? 'init' : nil). |
| 81 | + that_requires("Package[#{package_name}]") |
85 | 82 | end |
86 | 83 |
|
87 | 84 | it { is_expected.to contain_file(include_dir).with_ensure('directory') } |
88 | | - it { is_expected.to contain_zabbix__startup(service_name).with(require: "Package[#{package_name}]") } |
| 85 | + it { is_expected.to contain_zabbix__startup(service_name).that_requires("Package[#{package_name}]") } |
89 | 86 | it { is_expected.to compile.with_all_deps } |
90 | 87 | it { is_expected.to contain_class('zabbix::params') } |
91 | 88 | end |
|
104 | 101 | when 'Debian' |
105 | 102 | # rubocop:disable RSpec/RepeatedExample |
106 | 103 | it { is_expected.to contain_class('zabbix::repo').with_zabbix_version(zabbix_version) } |
107 | | - it { is_expected.to contain_package('zabbix-agent').with_require('Class[Zabbix::Repo]') } |
| 104 | + it { is_expected.to contain_package('zabbix-agent').that_requires('Class[Zabbix::Repo]') } |
108 | 105 | it { is_expected.to contain_apt__source('zabbix') } |
109 | 106 | when 'RedHat' |
110 | 107 | it { is_expected.to contain_class('zabbix::repo').with_zabbix_version(zabbix_version) } |
111 | | - it { is_expected.to contain_package('zabbix-agent').with_require('Class[Zabbix::Repo]') } |
| 108 | + it { is_expected.to contain_package('zabbix-agent').that_requires('Class[Zabbix::Repo]') } |
112 | 109 | it { is_expected.to contain_yumrepo('zabbix-nonsupported') } |
113 | 110 | it { is_expected.to contain_yumrepo('zabbix') } |
114 | 111 | # rubocop:enable RSpec/RepeatedExample |
|
347 | 344 | end |
348 | 345 |
|
349 | 346 | it do |
350 | | - is_expected.to contain_service(service_name).with( |
351 | | - ensure: 'stopped', |
352 | | - enable: false, |
353 | | - require: "Package[#{package_name}]" |
354 | | - ) |
| 347 | + is_expected.to contain_service(service_name). |
| 348 | + with_ensure('stopped'). |
| 349 | + with_enable(false). |
| 350 | + that_requires("Package[#{package_name}]") |
355 | 351 | end |
356 | 352 | end |
357 | 353 | end |
|
0 commit comments