Skip to content

Commit 51846f3

Browse files
committed
trying to fix rspec-puppet
1 parent a38dd1a commit 51846f3

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

.rubocop_todo.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2023-08-17 21:37:37 UTC using RuboCop version 1.50.2.
3+
# on 2024-05-18 22:27:55 UTC using RuboCop version 1.50.2.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -20,3 +20,13 @@ RSpec/BeEq:
2020
RSpec/PendingWithoutReason:
2121
Exclude:
2222
- 'spec/acceptance/class_spec.rb'
23+
24+
# Offense count: 4
25+
RSpec/RepeatedExampleGroupBody:
26+
Exclude:
27+
- 'spec/classes/rabbitmq_spec.rb'
28+
29+
# Offense count: 14
30+
RSpec/RepeatedExampleGroupDescription:
31+
Exclude:
32+
- 'spec/classes/rabbitmq_spec.rb'

lib/puppet/type/rabbitmq_parameter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
[self[:name].split('@')[1]]
8686
end
8787

88-
def set_parameters(hash) # rubocop:disable Style/AccessorMethodName
88+
def set_parameters(hash) # rubocop:disable Naming/AccessorMethodName
8989
# Hack to ensure :autoconvert is initialized before :value
9090
self[:autoconvert] = hash[:autoconvert] if hash.key?(:autoconvert)
9191
super

spec/classes/rabbitmq_spec.rb

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# frozen_string_literal: true
22

3-
# rubocop:disable RSpec/RepeatedExampleGroupDescription
4-
# rubocop:disable RSpec/RepeatedExampleGroupBody
5-
63
require 'spec_helper'
74

85
describe 'rabbitmq' do
@@ -144,13 +141,13 @@
144141
it { is_expected.not_to contain_file('/etc/default/rabbitmq-server') }
145142
end
146143

147-
if os_facts[:systemd]
144+
if os_facts['systemd']
148145
selinux_ignore_defaults = os_facts[:os]['family'] == 'RedHat'
149146

150147
it do
151148
is_expected.to contain_systemd__service_limits("#{name}.service").
152149
with_selinux_ignore_defaults(selinux_ignore_defaults).
153-
with_limits('LimitNOFILE' => value).
150+
with_limits({ 'LimitNOFILE' => value, 'OOMScoreAdjust' => 0 }).
154151
with_restart_service(false)
155152
end
156153
else
@@ -179,10 +176,10 @@
179176
it { is_expected.not_to contain_file('/etc/default/rabbitmq-server') }
180177
end
181178

182-
if os_facts[:systemd]
179+
if os_facts['systemd']
183180
it do
184181
is_expected.to contain_systemd__service_limits("#{name}.service").
185-
with_limits('OOMScoreAdjust' => value).
182+
with_limits({ 'LimitNOFILE' => 16_384, 'OOMScoreAdjust' => value }).
186183
with_restart_service(false)
187184
end
188185
else
@@ -201,14 +198,14 @@
201198
end
202199
end
203200

204-
context 'on systems with systemd', if: os_facts[:systemd] do
201+
context 'on systems with systemd', if: os_facts['systemd'] do
205202
it do
206203
is_expected.to contain_systemd__service_limits("#{name}.service").
207204
with_restart_service(false)
208205
end
209206
end
210207

211-
context 'on systems without systemd', unless: os_facts[:systemd] do
208+
context 'on systems without systemd', unless: os_facts['systemd'] do
212209
it { is_expected.not_to contain_systemd__service_limits("#{name}.service") }
213210
end
214211

@@ -1806,6 +1803,3 @@
18061803
end
18071804
end
18081805
end
1809-
1810-
# rubocop:enable RSpec/RepeatedExampleGroupDescription
1811-
# rubocop:enable RSpec/RepeatedExampleGroupBody

0 commit comments

Comments
 (0)