Skip to content

Commit 024c4c0

Browse files
committed
rubocop: autofix
1 parent d7da3cf commit 024c4c0

File tree

7 files changed

+31
-17
lines changed

7 files changed

+31
-17
lines changed

.rubocop.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
2+
inherit_from: .rubocop_todo.yml
3+
24
# Managed by modulesync - DO NOT EDIT
35
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
46

.rubocop_todo.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This configuration was generated by
2+
# `rubocop --auto-gen-config`
3+
# on 2023-08-17 21:37:37 UTC using RuboCop version 1.50.2.
4+
# The point is for the user to remove these configuration records
5+
# one by one as the offenses are removed from the code base.
6+
# Note that changes in the inspected code, or installation of new
7+
# versions of RuboCop, may require this file to be generated again.
8+
9+
# Offense count: 8
10+
# This cop supports unsafe autocorrection (--autocorrect-all).
11+
RSpec/BeEq:
12+
Exclude:
13+
- 'spec/unit/puppet/provider/rabbitmq_plugin/rabbitmqctl_spec.rb'
14+
- 'spec/unit/puppet/provider/rabbitmq_policy/rabbitmqctl_spec.rb'
15+
- 'spec/unit/puppet/provider/rabbitmq_user_permissions/rabbitmqctl_spec.rb'
16+
- 'spec/unit/puppet/provider/rabbitmq_vhost/rabbitmqctl_spec.rb'
17+
- 'spec/unit/puppet/type/rabbitmq_user_permissions_spec.rb'
18+
19+
# Offense count: 3
20+
RSpec/PendingWithoutReason:
21+
Exclude:
22+
- 'spec/acceptance/class_spec.rb'

lib/facter/rabbitmq_nodename.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
if Facter::Util::Resolution.which('rabbitmqctl')
66
rabbitmq_nodename = Facter::Core::Execution.execute('rabbitmqctl status 2>&1')
77
begin
8-
%r{^Status of node '?([\w.\-]+@[\w.\-]+)'?}.match(rabbitmq_nodename)[1]
8+
%r{^Status of node '?([\w.-]+@[\w.-]+)'?}.match(rabbitmq_nodename)[1]
99
rescue StandardError
1010
Facter.debug("Error: rabbitmq_nodename facter failed. Output was #{rabbitmq_nodename}")
1111
end

spec/classes/rabbitmq_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@
372372
describe 'does not contain pre-ranch settings with default config' do
373373
it do
374374
is_expected.to contain_file('rabbitmq.config'). \
375-
without_content(%r{binary,}). \
375+
without_content(%r{binary,}). \
376376
without_content(%r{\{packet, raw\},}). \
377377
without_content(%r{\{reuseaddr, true\},})
378378
end
@@ -383,7 +383,7 @@
383383

384384
it do
385385
is_expected.to contain_file('rabbitmq.config'). \
386-
with_content(%r{binary,}). \
386+
with_content(%r{binary,}). \
387387
with_content(%r{\{packet, raw\},}). \
388388
with_content(%r{\{reuseaddr, true\},})
389389
end

spec/unit/facter/util/fact_rabbitmq_plugins_dirs_spec.rb

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,15 @@
1010
it do
1111
Facter::Util::Resolution.expects(:which).with('rabbitmqctl').returns(true)
1212
Facter::Core::Execution.expects(:execute).with("rabbitmqctl eval 'application:get_env(rabbit, plugins_dir).'").returns('{ok,"/usr/lib/rabbitmq/plugins:/usr/lib/rabbitmq/lib/rabbitmq_server-3.7.10/plugins"}')
13-
expect(Facter.fact(:rabbitmq_plugins_dirs).value).to match_array(
14-
[
15-
'/usr/lib/rabbitmq/plugins',
16-
'/usr/lib/rabbitmq/lib/rabbitmq_server-3.7.10/plugins'
17-
]
18-
)
13+
expect(Facter.fact(:rabbitmq_plugins_dirs).value).to contain_exactly('/usr/lib/rabbitmq/plugins', '/usr/lib/rabbitmq/lib/rabbitmq_server-3.7.10/plugins')
1914
end
2015
end
2116

2217
context 'with only 1 plugins dir' do
2318
it do
2419
Facter::Util::Resolution.expects(:which).with('rabbitmqctl').returns(true)
2520
Facter::Core::Execution.expects(:execute).with("rabbitmqctl eval 'application:get_env(rabbit, plugins_dir).'").returns('{ok,"/usr/lib/rabbitmq/lib/rabbitmq_server-0.0.0/plugins"}')
26-
expect(Facter.fact(:rabbitmq_plugins_dirs).value).to match_array(
27-
[
28-
'/usr/lib/rabbitmq/lib/rabbitmq_server-0.0.0/plugins'
29-
]
30-
)
21+
expect(Facter.fact(:rabbitmq_plugins_dirs).value).to contain_exactly('/usr/lib/rabbitmq/lib/rabbitmq_server-0.0.0/plugins')
3122
end
3223
end
3324

spec/unit/puppet/provider/rabbitmq_user_permissions/rabbitmqctl_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@
3737
end
3838

3939
it 'does not match an empty list' do
40-
provider.class.expects(:rabbitmqctl_list).with('user_permissions', 'foo').returns <<-EOT
41-
EOT
40+
provider.class.expects(:rabbitmqctl_list).with('user_permissions', 'foo').returns ''
4241
expect(provider.exists?).to eq(nil)
4342
end
4443

spec/unit/puppet/type/rabbitmq_parameter_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797

9898
it 'does not convert numeric string to integer' do
9999
expect(parameter[:value]['myparameter']).to eq('1800000')
100-
expect(parameter[:value]['myparameter']).to be_kind_of(String)
100+
expect(parameter[:value]['myparameter']).to be_a(String)
101101
end
102102
end
103103
end

0 commit comments

Comments
 (0)