Skip to content

Commit 92627d6

Browse files
author
jordanbreen28
committed
(CONT-792) - Correct RSpec/EmptyLineAfterExample
1 parent 8e0275a commit 92627d6

18 files changed

+74
-11
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,6 @@ RSpec/ContextWording:
7171
RSpec/DescribeClass:
7272
Enabled: false
7373

74-
# Offense count: 1
75-
# This cop supports safe autocorrection (--autocorrect).
76-
RSpec/EmptyHook:
77-
Exclude:
78-
- 'spec/unit/provider/postgresql_conf/parsed_spec.rb'
79-
80-
# Offense count: 74
81-
# This cop supports safe autocorrection (--autocorrect).
82-
# Configuration parameters: AllowConsecutiveOneLiners.
83-
RSpec/EmptyLineAfterExample:
84-
Enabled: false
8574

8675
# Offense count: 29
8776
# This cop supports safe autocorrection (--autocorrect).

spec/acceptance/server/grant_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ class { 'postgresql::server': }
255255
end
256256
end
257257
end
258+
258259
it 'grants execute on a function with argument to a user' do
259260
if Gem::Version.new(postgresql_version) >= Gem::Version.new('9.0')
260261
idempotent_apply(pp)

spec/classes/lib/java_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
tag: 'puppetlabs-postgresql',
2626
)
2727
}
28+
2829
describe 'when parameters are supplied' do
2930
let :params do
3031
{ package_ensure: 'latest', package_name: 'somepackage' }

spec/classes/lib/pgdocs_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
tag: 'puppetlabs-postgresql',
1414
)
1515
}
16+
1617
describe 'when parameters are supplied' do
1718
let :params do
1819
{ package_ensure: 'latest', package_name: 'somepackage' }

spec/classes/server/config_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class { 'postgresql::server': }
9090
ensure: 'file', owner: 'root', group: 'root',
9191
)
9292
end
93+
9394
it 'has the correct systemd-override file #regex' do
9495
is_expected.to contain_file('/etc/systemd/system/postgresql-14.service.d/postgresql-14.conf').without_content(%r{\.include})
9596
end
@@ -174,6 +175,7 @@ class { 'postgresql::server':
174175
it 'has hba rule default' do
175176
is_expected.to contain_postgresql__server__pg_hba_rule('local access as postgres user')
176177
end
178+
177179
it 'has hba rule ipv4acls' do
178180
is_expected.to contain_postgresql__server__pg_hba_rule('postgresql class generated rule ipv4acls 0')
179181
end

spec/classes/server/plperl_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
describe 'with no parameters' do
1313
it { is_expected.to contain_class('postgresql::server::plperl') }
14+
1415
it 'creates package' do
1516
is_expected.to contain_package('postgresql-plperl').with(ensure: 'present',
1617
tag: 'puppetlabs-postgresql')
@@ -26,6 +27,7 @@
2627
end
2728

2829
it { is_expected.to contain_class('postgresql::server::plperl') }
30+
2931
it 'creates package with correct params' do
3032
is_expected.to contain_package('postgresql-plperl').with(ensure: 'absent',
3133
name: 'mypackage',

spec/classes/server/plpython_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
describe 'on RedHat with no parameters' do
1313
it { is_expected.to contain_class('postgresql::server::plpython') }
14+
1415
it 'creates package' do
1516
is_expected.to contain_package('postgresql-plpython').with(ensure: 'present',
1617
tag: 'puppetlabs-postgresql')
@@ -26,6 +27,7 @@
2627
end
2728

2829
it { is_expected.to contain_class('postgresql::server::plpython') }
30+
2931
it 'creates package with correct params' do
3032
is_expected.to contain_package('postgresql-plpython').with(ensure: 'absent',
3133
name: 'mypackage',

spec/classes/server_spec.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
it { is_expected.to contain_class('postgresql::params') }
1010
it { is_expected.to contain_class('postgresql::server') }
1111
it { is_expected.to contain_file('/var/lib/postgresql/13/main') }
12+
1213
it {
1314
is_expected.to contain_exec('postgresql_reload').with('command' => 'systemctl reload postgresql')
1415
}
16+
1517
it 'validates connection' do
1618
is_expected.to contain_postgresql_conn_validator('validate_service_is_running')
1719
end
@@ -57,9 +59,11 @@ class { 'postgresql::globals':
5759
it { is_expected.to contain_class('postgresql::params') }
5860
it { is_expected.to contain_class('postgresql::server') }
5961
it { is_expected.to contain_class('postgresql::server::passwd') }
62+
6063
it 'validates connection' do
6164
is_expected.to contain_postgresql_conn_validator('validate_service_is_running')
6265
end
66+
6367
it 'sets postgres password' do
6468
is_expected.to contain_exec('set_postgres_postgrespw').with('command' => '/usr/bin/psql -c "ALTER ROLE \"postgres\" PASSWORD ${NEWPASSWD_ESCAPED}"',
6569
'user' => 'postgres',
@@ -79,9 +83,11 @@ class { 'postgresql::globals':
7983
it { is_expected.to contain_class('postgresql::params') }
8084
it { is_expected.to contain_class('postgresql::server') }
8185
it { is_expected.to contain_class('postgresql::server::passwd') }
86+
8287
it 'validates connection' do
8388
is_expected.to contain_postgresql_conn_validator('validate_service_is_running')
8489
end
90+
8591
it 'sets postgres password' do
8692
is_expected.to contain_exec('set_postgres_postgrespw').with('command' => ['/usr/bin/psql -c "ALTER ROLE \"postgres\" PASSWORD ${NEWPASSWD_ESCAPED}"'],
8793
'user' => 'postgres',
@@ -95,6 +101,7 @@ class { 'postgresql::globals':
95101

96102
it { is_expected.to contain_class('postgresql::params') }
97103
it { is_expected.to contain_class('postgresql::server') }
104+
98105
it 'shouldnt validate connection' do
99106
is_expected.not_to contain_postgresql_conn_validator('validate_service_is_running')
100107
end
@@ -105,9 +112,11 @@ class { 'postgresql::globals':
105112

106113
it { is_expected.to contain_class('postgresql::params') }
107114
it { is_expected.to contain_class('postgresql::server') }
115+
108116
it {
109117
is_expected.not_to contain_Postgresql_conf('data_directory').that_notifies('Class[postgresql::server::service]')
110118
}
119+
111120
it 'validates connection' do
112121
is_expected.to contain_postgresql_conn_validator('validate_service_is_running')
113122
end
@@ -118,9 +127,11 @@ class { 'postgresql::globals':
118127

119128
it { is_expected.to contain_class('postgresql::params') }
120129
it { is_expected.to contain_class('postgresql::server') }
130+
121131
it {
122132
is_expected.to contain_Postgresql_conf('data_directory').that_notifies('Class[postgresql::server::service]')
123133
}
134+
124135
it 'validates connection' do
125136
is_expected.to contain_postgresql_conn_validator('validate_service_is_running')
126137
end
@@ -131,9 +142,11 @@ class { 'postgresql::globals':
131142

132143
it { is_expected.to contain_class('postgresql::params') }
133144
it { is_expected.to contain_class('postgresql::server') }
145+
134146
it {
135147
is_expected.to contain_exec('postgresql_reload').with('command' => '/bin/true')
136148
}
149+
137150
it 'validates connection' do
138151
is_expected.to contain_postgresql_conn_validator('validate_service_is_running')
139152
end
@@ -149,6 +162,7 @@ class { 'postgresql::globals':
149162
let(:params) { { service_manage: false } }
150163

151164
it { is_expected.not_to contain_service('postgresqld') }
165+
152166
it 'shouldnt validate connection' do
153167
is_expected.not_to contain_postgresql_conn_validator('validate_service_is_running')
154168
end
@@ -247,6 +261,7 @@ class { 'postgresql::globals':
247261
end
248262

249263
it { is_expected.to compile.with_all_deps }
264+
250265
it do
251266
is_expected.to contain_postgresql__server__pg_hba_rule('from_remote_host')
252267
.with_type('host')
@@ -283,25 +298,30 @@ class { 'postgresql::globals':
283298

284299
it { is_expected.to contain_class('postgresql::server') }
285300
it { is_expected.to contain_class('postgresql::backup::pg_dump') }
301+
286302
it {
287303
is_expected.to contain_postgresql__server__role('backupuser')
288304
.with_superuser(true)
289305
}
306+
290307
it {
291308
is_expected.to contain_postgresql__server__pg_hba_rule('local access as backup user')
292309
.with_type('local')
293310
.with_database('all')
294311
.with_user('backupuser')
295312
.with_auth_method('md5')
296313
}
314+
297315
it {
298316
is_expected.to contain_file('/root/.pgpass')
299317
.with_content(%r{.*:backupuser:.*})
300318
}
319+
301320
it {
302321
is_expected.to contain_file('/usr/local/sbin/pg_dump.sh')
303322
.with_content(%r{.*pg_dumpall \$_pg_args --file=\$\{FILE\} \$@.*})
304323
}
324+
305325
it {
306326
is_expected.to contain_cron('pg_dump backup job')
307327
.with(

spec/defines/server/default_privileges_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444

4545
it { is_expected.to compile.with_all_deps }
4646
it { is_expected.to contain_postgresql__server__default_privileges('test') }
47+
4748
it do
4849
is_expected.to contain_postgresql_psql('default_privileges:test')
4950
.with_command('ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO "test"')
@@ -86,6 +87,7 @@
8687

8788
it { is_expected.to compile.with_all_deps }
8889
it { is_expected.to contain_postgresql__server__default_privileges('test') }
90+
8991
it do
9092
# rubocop:disable Layout/LineLength
9193
is_expected.to contain_postgresql_psql('default_privileges:test')
@@ -156,6 +158,7 @@ class { 'postgresql::server': }
156158

157159
it { is_expected.to compile.with_all_deps }
158160
it { is_expected.to contain_postgresql__server__default_privileges('test') }
161+
159162
it do
160163
# rubocop:disable Layout/LineLength
161164
is_expected.to contain_postgresql_psql('default_privileges:test')
@@ -274,6 +277,7 @@ class { 'postgresql::server': }
274277

275278
it { is_expected.to compile.with_all_deps }
276279
it { is_expected.to contain_postgresql__server__default_privileges('test') }
280+
277281
it do
278282
# rubocop:disable Layout/LineLength
279283
is_expected.to contain_postgresql_psql('default_privileges:test')
@@ -300,6 +304,7 @@ class { 'postgresql::server': }
300304

301305
it { is_expected.to compile.with_all_deps }
302306
it { is_expected.to contain_postgresql__server__default_privileges('test') }
307+
303308
it do
304309
# rubocop:disable Layout/LineLength
305310
is_expected.to contain_postgresql_psql('default_privileges:test')
@@ -329,6 +334,7 @@ class {'postgresql::server':}
329334
it { is_expected.to compile.with_all_deps }
330335
it { is_expected.to contain_postgresql__server__default_privileges('test') }
331336
it { is_expected.to contain_postgresql__server__role('test') }
337+
332338
it do
333339
is_expected.to contain_postgresql_psql('default_privileges:test') \
334340
.that_requires(['Service[postgresqld]', 'Postgresql::Server::Role[test]'])
@@ -356,6 +362,7 @@ class {'postgresql::server':}
356362
it { is_expected.to compile.with_all_deps }
357363
it { is_expected.to contain_postgresql__server__default_privileges('test') }
358364
it { is_expected.to contain_postgresql__server__role('target') }
365+
359366
it do
360367
# rubocop:disable Layout/LineLength
361368
is_expected.to contain_postgresql_psql('default_privileges:test')

spec/defines/server/extension_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@
207207
end
208208

209209
it { is_expected.to compile.with_all_deps }
210+
210211
it {
211212
is_expected.to contain_postgresql_psql('postgres: CREATE EXTENSION "pg_repack"')
212213
.with_connect_settings('PGHOST' => 'postgres-db-server', 'DBVERSION' => '9.1', 'PGPORT' => '1234')
@@ -231,6 +232,7 @@
231232
end
232233

233234
it { is_expected.to compile.with_all_deps }
235+
234236
it {
235237
is_expected.to contain_postgresql_psql('postgres: CREATE EXTENSION "pg_repack"')
236238
.with_connect_settings('PGHOST' => 'postgres-db-server', 'DBVERSION' => '9.1', 'PGPORT' => '1234')

0 commit comments

Comments
 (0)