Skip to content

Commit 5664360

Browse files
coreonerobinbowes
authored andcommitted
Fix rubocop checks (rodjek#53)
1 parent 5bf6fc4 commit 5664360

File tree

5 files changed

+227
-227
lines changed

5 files changed

+227
-227
lines changed

spec/classes/defaults_spec.rb

+14-14
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@
1010
case facts[:operatingsystem]
1111
when 'Debian'
1212
it do
13-
should contain_logrotate__rule('wtmp').with('rotate_every' => 'month',
14-
'rotate' => '1',
15-
'create' => true,
16-
'create_mode' => '0664',
17-
'create_owner' => 'root',
18-
'create_group' => 'utmp',
19-
'missingok' => true)
13+
is_expected.to contain_logrotate__rule('wtmp').with('rotate_every' => 'month',
14+
'rotate' => '1',
15+
'create' => true,
16+
'create_mode' => '0664',
17+
'create_owner' => 'root',
18+
'create_group' => 'utmp',
19+
'missingok' => true)
2020

21-
should contain_logrotate__rule('btmp').with('rotate_every' => 'month',
22-
'rotate' => '1',
23-
'create' => true,
24-
'create_mode' => '0600',
25-
'create_owner' => 'root',
26-
'create_group' => 'utmp',
27-
'missingok' => true)
21+
is_expected.to contain_logrotate__rule('btmp').with('rotate_every' => 'month',
22+
'rotate' => '1',
23+
'create' => true,
24+
'create_mode' => '0600',
25+
'create_owner' => 'root',
26+
'create_group' => 'utmp',
27+
'missingok' => true)
2828
end
2929
end
3030
end

spec/classes/hourly_spec.rb

+16-16
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,38 @@
33
describe 'logrotate::hourly' do
44
context 'with default values' do
55
it do
6-
should contain_file('/etc/logrotate.d/hourly').with('ensure' => 'directory',
7-
'owner' => 'root',
8-
'group' => 'root',
9-
'mode' => '0755')
6+
is_expected.to contain_file('/etc/logrotate.d/hourly').with('ensure' => 'directory',
7+
'owner' => 'root',
8+
'group' => 'root',
9+
'mode' => '0755')
1010
end
1111

1212
it do
13-
should contain_file('/etc/cron.hourly/logrotate').with('ensure' => 'present',
14-
'owner' => 'root',
15-
'group' => 'root',
16-
'mode' => '0555',
17-
'source' => 'puppet:///modules/logrotate/etc/cron.hourly/logrotate',
18-
'require' => [
19-
'File[/etc/logrotate.d/hourly]',
20-
'Package[logrotate]'
21-
])
13+
is_expected.to contain_file('/etc/cron.hourly/logrotate').with('ensure' => 'present',
14+
'owner' => 'root',
15+
'group' => 'root',
16+
'mode' => '0555',
17+
'source' => 'puppet:///modules/logrotate/etc/cron.hourly/logrotate',
18+
'require' => [
19+
'File[/etc/logrotate.d/hourly]',
20+
'Package[logrotate]'
21+
])
2222
end
2323
end
2424

2525
context 'with ensure => absent' do
2626
let(:params) { { ensure: 'absent' } }
2727

28-
it { should contain_file('/etc/logrotate.d/hourly').with_ensure('absent') }
29-
it { should contain_file('/etc/cron.hourly/logrotate').with_ensure('absent') }
28+
it { is_expected.to contain_file('/etc/logrotate.d/hourly').with_ensure('absent') }
29+
it { is_expected.to contain_file('/etc/cron.hourly/logrotate').with_ensure('absent') }
3030
end
3131

3232
context 'with ensure => foo' do
3333
let(:params) { { ensure: 'foo' } }
3434

3535
it do
3636
expect do
37-
should contain_file('/etc/logrotate.d/hourly')
37+
is_expected.to contain_file('/etc/logrotate.d/hourly')
3838
end.to raise_error(Puppet::Error, %r{Invalid ensure value 'foo'})
3939
end
4040
end

spec/classes/init_spec.rb

+11-11
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
it { is_expected.to compile.with_all_deps }
1515

1616
it do
17-
should contain_package('logrotate').with_ensure('present')
17+
is_expected.to contain_package('logrotate').with_ensure('present')
1818

1919
# should contain_file('/etc/logrotate.conf').with({
2020
# 'ensure' => 'file',
@@ -26,18 +26,18 @@
2626
# 'require' => 'Package[logrotate]',
2727
# })
2828

29-
should contain_file('/etc/logrotate.d').with('ensure' => 'directory',
30-
'owner' => 'root',
31-
'group' => 'root',
32-
'mode' => '0755')
29+
is_expected.to contain_file('/etc/logrotate.d').with('ensure' => 'directory',
30+
'owner' => 'root',
31+
'group' => 'root',
32+
'mode' => '0755')
3333

34-
should contain_file('/etc/cron.daily/logrotate').with('ensure' => 'file',
35-
'owner' => 'root',
36-
'group' => 'root',
37-
'mode' => '0555',
38-
'source' => 'puppet:///modules/logrotate/etc/cron.daily/logrotate')
34+
is_expected.to contain_file('/etc/cron.daily/logrotate').with('ensure' => 'file',
35+
'owner' => 'root',
36+
'group' => 'root',
37+
'mode' => '0555',
38+
'source' => 'puppet:///modules/logrotate/etc/cron.daily/logrotate')
3939

40-
should contain_class('logrotate::defaults')
40+
is_expected.to contain_class('logrotate::defaults')
4141
end
4242
end
4343
end

0 commit comments

Comments
 (0)