|
2 | 2 |
|
3 | 3 | require 'spec_helper' |
4 | 4 |
|
5 | | -describe 'collectd::plugin::fscache', type: :class do |
6 | | - test_on = { |
7 | | - hardwaremodels: ['x86_64'], |
8 | | - supported_os: [ |
9 | | - { |
10 | | - 'operatingsystem' => 'FreeBSD', |
11 | | - 'operatingsystemrelease' => %w[9 10] |
12 | | - } |
13 | | - ] |
14 | | - } |
| 5 | +describe 'collectd::plugin::fscache' do |
| 6 | + on_supported_os.each do |os, os_facts| |
| 7 | + context "on #{os}" do |
| 8 | + let(:facts) { os_facts } |
15 | 9 |
|
16 | | - on_supported_os(test_on).each do |_os, facts| |
17 | | - let(:facts) { facts } |
18 | | - end |
19 | | - |
20 | | - context ':ensure => present' do |
21 | | - it 'Will create 10-fscache.conf' do |
22 | | - is_expected.to contain_file('fscache.load').with( |
23 | | - ensure: 'present', |
24 | | - path: '/usr/local/etc/collectd/10-fscache.conf', |
25 | | - content: %r{\#\ Generated by Puppet\n<LoadPlugin fscache>\n} |
26 | | - ) |
27 | | - end |
28 | | - end |
| 10 | + context ':ensure => present' do |
| 11 | + it 'Will create 10-fscache.conf' do |
| 12 | + is_expected.to contain_file('fscache.load').with( |
| 13 | + ensure: 'present', |
| 14 | + content: %r{\#\ Generated by Puppet\n<LoadPlugin fscache>\n} |
| 15 | + ) |
| 16 | + end |
| 17 | + end |
29 | 18 |
|
30 | | - context ':ensure => absent' do |
31 | | - let(:params) { { ensure: 'absent' } } |
| 19 | + context ':ensure => absent' do |
| 20 | + let(:params) { { ensure: 'absent' } } |
32 | 21 |
|
33 | | - it 'Will not create 10-fscache.conf' do |
34 | | - is_expected.to contain_file('fscache.load').with( |
35 | | - ensure: 'absent', |
36 | | - path: '/usr/local/etc/collectd/10-fscache.conf' |
37 | | - ) |
| 22 | + it 'Will not create 10-fscache.conf' do |
| 23 | + is_expected.to contain_file('fscache.load').with_ensure('absent') |
| 24 | + end |
| 25 | + end |
38 | 26 | end |
39 | 27 | end |
40 | 28 | end |
0 commit comments