Skip to content

Commit dac20d0

Browse files
committed
rubocop: autocorrect
1 parent 5e38e7e commit dac20d0

12 files changed

Lines changed: 344 additions & 325 deletions

.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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This configuration was generated by
2+
# `rubocop --auto-gen-config --no-auto-gen-timestamp`
3+
# using RuboCop version 1.85.1.
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: 7
10+
RSpec/LeakyLocalVariable:
11+
Exclude:
12+
- 'spec/classes/openvpn_install_spec.rb'
13+
- 'spec/defines/openvpn_ca_spec.rb'
14+
- 'spec/defines/openvpn_client_spec.rb'
15+
- 'spec/defines/openvpn_client_specific_config_spec.rb'
16+
- 'spec/defines/openvpn_revoke_spec.rb'
17+
- 'spec/defines/openvpn_server_spec.rb'

spec/acceptance/openvpn_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
end
2222

2323
['/etc/openvpn/server/test_openvpn_server',
24-
'/etc/openvpn/server/test_openvpn_server/keys'].each do |dir|
24+
'/etc/openvpn/server/test_openvpn_server/keys',].each do |dir|
2525
describe file(dir) do
2626
it { is_expected.to be_directory }
2727
end
@@ -75,7 +75,7 @@
7575
'/etc/openvpn/server/test_openvpn_server/keys/private/vpnclienta.key',
7676
'/etc/openvpn/server/test_openvpn_server/keys/private/vpnclientb.key',
7777
'/etc/openvpn/server/test_openvpn_server/keys/issued/vpnclienta.crt',
78-
'/etc/openvpn/server/test_openvpn_server/keys/issued/vpnclientb.crt'].each do |path|
78+
'/etc/openvpn/server/test_openvpn_server/keys/issued/vpnclientb.crt',].each do |path|
7979
describe file(path) do
8080
it { is_expected.to be_file }
8181
end

spec/classes/openvpn_config_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
context "on #{os}" do
88
let(:facts) do
99
os_facts.merge(
10-
easyrsa: '3.0'
10+
easyrsa: '3.0',
1111
)
1212
end
1313

spec/classes/openvpn_init_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
context "on #{os}" do
88
let(:facts) do
99
os_facts.merge(
10-
easyrsa: '3.0'
10+
easyrsa: '3.0',
1111
)
1212
end
1313

spec/classes/openvpn_install_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
context "on #{os}" do
88
let(:facts) do
99
os_facts.merge(
10-
easyrsa: '3.0'
10+
easyrsa: '3.0',
1111
)
1212
end
1313
let(:pre_condition) { 'include openvpn' }

spec/classes/openvpn_service_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
context "on #{os}" do
88
let(:facts) do
99
os_facts.merge(
10-
easyrsa: '3.0'
10+
easyrsa: '3.0',
1111
)
1212
end
1313
let(:pre_condition) { 'include openvpn' }

spec/defines/openvpn_ca_spec.rb

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
context "on #{os}" do
88
let(:facts) do
99
os_facts.merge(
10-
easyrsa: '3.0'
10+
easyrsa: '3.0',
1111
)
1212
end
1313
let(:title) { 'test_server' }
@@ -30,7 +30,7 @@
3030
'province' => 'ST',
3131
'city' => 'Some City',
3232
'organization' => 'example.org',
33-
'email' => '[email protected]'
33+
'email' => '[email protected]',
3434
}
3535
end
3636

@@ -47,8 +47,8 @@
4747
it { is_expected.to contain_file("#{server_directory}/test_server/easy-rsa/vars").with_mode('0550') }
4848

4949
it {
50-
is_expected.to contain_file("#{server_directory}/test_server/keys").
51-
with(ensure: 'link', target: "#{server_directory}/test_server/easy-rsa/keys")
50+
is_expected.to contain_file("#{server_directory}/test_server/keys")
51+
.with(ensure: 'link', target: "#{server_directory}/test_server/easy-rsa/keys")
5252
}
5353

5454
it { is_expected.to contain_file("#{server_directory}/test_server/easy-rsa/openssl.cnf") }
@@ -69,12 +69,12 @@
6969
it { is_expected.to contain_exec('copy created crl.pem to test_server keys directory').with_command("cp #{server_directory}/test_server/easy-rsa/keys/crl.pem #{server_directory}/test_server/crl.pem") }
7070

7171
it {
72-
is_expected.to contain_file("#{server_directory}/test_server/easy-rsa/vars").
73-
with_content(%r{set_var EASYRSA_REQ_COUNTRY "CO"$}).
74-
with_content(%r{set_var EASYRSA_REQ_PROVINCE "ST"$}).
75-
with_content(%r{set_var EASYRSA_REQ_CITY "Some City"$}).
76-
with_content(%r{set_var EASYRSA_REQ_ORG "example.org"$}).
77-
with_content(%r{set_var EASYRSA_REQ_EMAIL "[email protected]"$})
72+
is_expected.to contain_file("#{server_directory}/test_server/easy-rsa/vars")
73+
.with_content(%r{set_var EASYRSA_REQ_COUNTRY "CO"$})
74+
.with_content(%r{set_var EASYRSA_REQ_PROVINCE "ST"$})
75+
.with_content(%r{set_var EASYRSA_REQ_CITY "Some City"$})
76+
.with_content(%r{set_var EASYRSA_REQ_ORG "example.org"$})
77+
.with_content(%r{set_var EASYRSA_REQ_EMAIL "[email protected]"$})
7878
}
7979
end
8080

@@ -95,21 +95,21 @@
9595
'key_expire' => 365,
9696
'key_cn' => 'yolo',
9797
'key_name' => 'burp',
98-
'key_ou' => 'NSA'
98+
'key_ou' => 'NSA',
9999
}
100100
end
101101

102102
it {
103-
is_expected.to contain_file("#{server_directory}/test_server/easy-rsa/vars").
104-
with_content(%r{set_var EASYRSA_DN "cn_only"$}).
105-
with_content(%r{set_var EASYRSA_CA_EXPIRE 365$}).
106-
with_content(%r{set_var EASYRSA_CERT_EXPIRE 365$}).
107-
with_content(%r{set_var EASYRSA_REQ_CN "yolo"$}).
108-
with_content(%r{set_var EASYRSA_REQ_OU "NSA"$}).
109-
with_content(%r{set_var EASYRSA_DIGEST sha256$}).
110-
with_content(%r{set_var EASYRSA_KEY_SIZE 2048$}).
111-
with_content(%r{set_var EASYRSA_ALGO rsa$}).
112-
without_content(%r{set_var EASYRSA_CURVE})
103+
is_expected.to contain_file("#{server_directory}/test_server/easy-rsa/vars")
104+
.with_content(%r{set_var EASYRSA_DN "cn_only"$})
105+
.with_content(%r{set_var EASYRSA_CA_EXPIRE 365$})
106+
.with_content(%r{set_var EASYRSA_CERT_EXPIRE 365$})
107+
.with_content(%r{set_var EASYRSA_REQ_CN "yolo"$})
108+
.with_content(%r{set_var EASYRSA_REQ_OU "NSA"$})
109+
.with_content(%r{set_var EASYRSA_DIGEST sha256$})
110+
.with_content(%r{set_var EASYRSA_KEY_SIZE 2048$})
111+
.with_content(%r{set_var EASYRSA_ALGO rsa$})
112+
.without_content(%r{set_var EASYRSA_CURVE})
113113
}
114114
end
115115

@@ -134,9 +134,9 @@
134134
end
135135

136136
it {
137-
is_expected.to contain_file("#{server_directory}/test_server/easy-rsa/vars").
138-
with_content(%r{set_var EASYRSA_ALGO ec$}).
139-
with_content(%r{set_var EASYRSA_CURVE secp384r1$})
137+
is_expected.to contain_file("#{server_directory}/test_server/easy-rsa/vars")
138+
.with_content(%r{set_var EASYRSA_ALGO ec$})
139+
.with_content(%r{set_var EASYRSA_CURVE secp384r1$})
140140
}
141141
end
142142

@@ -149,9 +149,9 @@
149149
end
150150

151151
it {
152-
is_expected.to contain_file("#{server_directory}/test_server/easy-rsa/vars").
153-
with_content(%r{set_var EASYRSA_ALGO ec$}).
154-
with_content(%r{set_var EASYRSA_CURVE secp521r1$})
152+
is_expected.to contain_file("#{server_directory}/test_server/easy-rsa/vars")
153+
.with_content(%r{set_var EASYRSA_ALGO ec$})
154+
.with_content(%r{set_var EASYRSA_CURVE secp521r1$})
155155
}
156156
end
157157
end

0 commit comments

Comments
 (0)