Skip to content

Commit 8209e74

Browse files
wyardleyroot-expert
andcommitted
[style] additional rubocop fixes and ignores
- Additional manual style updates for rubocop warnings - Ignore warnings about duplicates in the class spec - Ignore remaining items (facter for erlang SSL path doesn't work with frozen strings set Co-authored-by: Christos Papageorgiou <[email protected]>
1 parent 44e677a commit 8209e74

File tree

12 files changed

+24
-24
lines changed

12 files changed

+24
-24
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ If you have Ruby 2.x or want a specific version of Puppet,
124124
you must set an environment variable such as:
125125

126126
```sh
127-
export PUPPET_GEM_VERSION="~> 5.5.6"
127+
export PUPPET_GEM_VERSION="~> 6.1.0"
128128
```
129129

130130
You can install all needed gems for spec tests into the modules directory by

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Managed by modulesync - DO NOT EDIT
22
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
33

4-
source ENV['GEM_SOURCE'] || "https://rubygems.org"
4+
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
55

66
group :test do
77
gem 'voxpupuli-test', '~> 5.0', :require => false

lib/facter/erl_ssl_path.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
# frozen_string_literal: true
1+
# rubocop:disable Style/FrozenStringLiteralComment
22

33
# Fact to get the ssl path for the erlang distribution in the current
44
# system as described in the RabbitMQ docs [1].
55
#
66
# [1] https://www.rabbitmq.com/clustering-ssl.html
7+
78
Facter.add(:erl_ssl_path) do
89
setcode do
910
if Facter::Util::Resolution.which('erl')
@@ -13,3 +14,4 @@
1314
end
1415
end
1516
end
17+
# rubocop:enable Style/FrozenStringLiteralComment

lib/puppet/type/rabbitmq_binding.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def self.title_patterns
115115

116116
newproperty(:arguments) do
117117
desc 'binding arguments'
118-
defaultto {}
118+
defaultto({})
119119
validate do |value|
120120
resource.validate_argument(value)
121121
end

lib/puppet/type/rabbitmq_erlang_cookie.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ def change_to_s(_current, _desired)
2323
'The rabbitmq erlang cookie was changed'
2424
end
2525

26-
# rubocop:disable Style/PredicateName
2726
def is_to_s(_value)
2827
'[old content redacted]'
2928
end
30-
# rubocop:enable Style/PredicateName
3129

3230
def should_to_s(_value)
3331
'[new content redacted]'

lib/puppet/type/rabbitmq_exchange.rb

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

6060
newparam(:arguments) do
6161
desc 'Exchange arguments example: {"hash-header": "message-distribution-hash"}'
62-
defaultto {}
62+
defaultto({})
6363
end
6464

6565
newparam(:user) do

lib/puppet/type/rabbitmq_queue.rb

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

4848
newparam(:arguments) do
4949
desc 'Queue arguments example: {x-message-ttl => 60, x-expires => 10}'
50-
defaultto {}
50+
defaultto({})
5151
validate do |value|
5252
resource.validate_argument(value)
5353
end

lib/puppet/type/rabbitmq_user.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,9 @@ def change_to_s(_current, _desired)
4949
'password has been changed'
5050
end
5151

52-
# rubocop:disable Style/PredicateName
5352
def is_to_s(_value)
5453
'[old password redacted]'
5554
end
56-
# rubocop:enable Style/PredicateName
5755

5856
def should_to_s(_value)
5957
'[new password redacted]'

spec/acceptance/class_spec.rb

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@
44

55
describe 'rabbitmq class:' do
66
case fact('os.family')
7-
when 'RedHat'
8-
package_name = 'rabbitmq-server'
9-
service_name = 'rabbitmq-server'
10-
when 'SUSE'
11-
package_name = 'rabbitmq-server'
12-
service_name = 'rabbitmq-server'
13-
when 'Debian'
7+
when 'RedHat', 'SUSE', 'Debian'
148
package_name = 'rabbitmq-server'
159
service_name = 'rabbitmq-server'
1610
when 'Archlinux'
@@ -124,7 +118,7 @@ class { 'rabbitmq':
124118
it { is_expected.to be_running }
125119
end
126120

127-
describe port(5672) do
121+
describe port(5672), :port5672 do
128122
it { is_expected.to be_listening.on('0.0.0.0').with('tcp') }
129123
end
130124

@@ -157,13 +151,14 @@ class { 'rabbitmq':
157151
it { is_expected.to be_running }
158152
end
159153

160-
describe port(5672) do
154+
describe port(5672), :port5671 do
161155
it { is_expected.to be_listening.on('127.0.0.1').with('tcp') }
162156
end
163157

164158
describe port(15_672) do
165159
it { is_expected.to be_listening.on('127.0.0.1').with('tcp') }
166160
end
161+
167162
# This listens on all interfaces regardless of these settings
168163

169164
describe port(25_672) do
@@ -195,7 +190,7 @@ class { 'rabbitmq':
195190
it { is_expected.to be_running }
196191
end
197192

198-
describe port(5671) do
193+
describe port(5671), :port5671 do
199194
it { is_expected.to be_listening.on('0.0.0.0').with('tcp') }
200195
end
201196

@@ -223,7 +218,7 @@ class { 'rabbitmq':
223218
it { is_expected.to be_running }
224219
end
225220

226-
describe port(5672) do
221+
describe port(5672), :port5672 do
227222
it { is_expected.to be_listening.on('0.0.0.0').with('tcp') }
228223
end
229224

spec/classes/rabbitmq_spec.rb

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

3+
# rubocop:disable RSpec/RepeatedExampleGroupDescription
4+
# rubocop:disable RSpec/RepeatedExampleGroupBody
5+
36
require 'spec_helper'
47

58
describe 'rabbitmq' do
@@ -1788,3 +1791,6 @@
17881791
end
17891792
end
17901793
end
1794+
1795+
# rubocop:enable RSpec/RepeatedExampleGroupDescription
1796+
# rubocop:enable RSpec/RepeatedExampleGroupBody

0 commit comments

Comments
 (0)