Skip to content

Commit 758ea2c

Browse files
author
jordanbreen28
committed
(CONT-792) - Correct RSpec/EmptyLineAfterExampleGroup
1 parent 92627d6 commit 758ea2c

File tree

10 files changed

+29
-14
lines changed

10 files changed

+29
-14
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,6 @@ RSpec/DescribeClass:
7272
Enabled: false
7373

7474

75-
# Offense count: 29
76-
# This cop supports safe autocorrection (--autocorrect).
77-
RSpec/EmptyLineAfterExampleGroup:
78-
Exclude:
79-
- 'spec/acceptance/server/grant_spec.rb'
80-
- 'spec/defines/server/pg_hba_rule_spec.rb'
81-
- 'spec/defines/server/pg_ident_rule_spec.rb'
82-
- 'spec/defines/server/recovery_spec.rb'
83-
- 'spec/type_aliases/pg_hba_rule_spec.rb'
84-
- 'spec/type_aliases/pg_hba_rules_spec.rb'
85-
- 'spec/unit/puppet/provider/postgresql_psql/ruby_spec.rb'
86-
- 'spec/unit/puppet/type/postgresql_conn_validator.rb'
87-
- 'spec/unit/puppet/type/postgresql_psql_spec.rb'
88-
8975
# Offense count: 2
9076
# This cop supports safe autocorrection (--autocorrect).
9177
# Configuration parameters: AllowConsecutiveOneLiners.

spec/acceptance/server/grant_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ class { 'postgresql::server': }
201201
end
202202
end
203203
end
204+
204205
### FUNCTION grants
205206
context 'sequence' do
206207
let(:pp) do
@@ -268,6 +269,7 @@ class { 'postgresql::server': }
268269
end
269270
end
270271
end
272+
271273
### TABLE grants
272274
context 'table' do
273275
describe 'GRANT ... ON TABLE' do
@@ -472,6 +474,7 @@ class { 'postgresql::server': }
472474
end
473475
end
474476
end
477+
475478
context 'database' do
476479
describe 'REVOKE ... ON DATABASE...' do
477480
it 'do not fail on revoke connect from non-existant user' do

spec/defines/server/pg_hba_rule_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ class { 'postgresql::server': }
248248
is_expected.to contain_concat__fragment('pg_hba_rule_test').with(content: %r{host\s+all\s+all\s+\.domain\.tld\s+md5})
249249
end
250250
end
251+
251252
context 'pg_hba_rule with illegal address' do
252253
let :pre_condition do
253254
<<-MANIFEST

spec/defines/server/pg_ident_rule_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class { 'postgresql::server': }
3333
is_expected.to contain_concat__fragment('pg_ident_rule_test').with(content: %r{thatsmymap\s+systemuser\s+dbuser})
3434
end
3535
end
36+
3637
context 'not managing pg_ident' do
3738
let :pre_condition do
3839
<<-MANIFEST

spec/defines/server/recovery_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class { 'postgresql::server': }
3333
.with(content: %r{restore_command = 'restore_command'[\n]+recovery_target_timeline = 'recovery_target_timeline'})
3434
end
3535
end
36+
3637
context 'not managing recovery' do
3738
let(:pre_condition) do
3839
<<-MANIFEST
@@ -53,6 +54,7 @@ class { 'postgresql::server': }
5354
%r{postgresql::server::manage_recovery_conf has been disabled})
5455
end
5556
end
57+
5658
context 'not managing recovery, missing param' do
5759
let(:pre_condition) do
5860
<<-MANIFEST

spec/type_aliases/pg_hba_rule_spec.rb

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

2121
it { is_expected.to allow_value(data) }
2222
end
23+
2324
context 'invalid data' do
2425
let :data do
2526
{
@@ -36,6 +37,7 @@
3637

3738
it { is_expected.not_to allow_value(data) }
3839
end
40+
3941
context 'empty data' do
4042
let :data do
4143
{}

spec/type_aliases/pg_hba_rules_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,15 @@
3333

3434
it { is_expected.to allow_value(data) }
3535
end
36+
3637
context 'empty' do
3738
let :data do
3839
{}
3940
end
4041

4142
it { is_expected.to allow_value(data) }
4243
end
44+
4345
context 'invalid data' do
4446
let :data do
4547
{
@@ -54,6 +56,7 @@
5456

5557
it { is_expected.not_to allow_value(data) }
5658
end
59+
5760
context 'empty value' do
5861
let :data do
5962
{

spec/unit/puppet/provider/postgresql_psql/ruby_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
provider.run_sql_command('SELECT \'something\' as "Custom column"')
2222
end
2323
end
24+
2425
describe 'with psql_path and db' do
2526
let(:attributes) do
2627
{
@@ -41,6 +42,7 @@
4142
provider.run_sql_command('SELECT \'something\' as "Custom column"')
4243
end
4344
end
45+
4446
describe 'with search_path string' do
4547
let(:attributes) do
4648
{
@@ -56,6 +58,7 @@
5658
provider.run_sql_command('SELECT \'something\' as "Custom column"')
5759
end
5860
end
61+
5962
describe 'with search_path array' do
6063
let(:attributes) do
6164
{
@@ -73,6 +76,7 @@
7376
end
7477
end
7578
end
79+
7680
describe 'with port string' do
7781
let(:attributes) { { port: '5555' } }
7882

@@ -85,6 +89,7 @@
8589
provider.run_sql_command('SELECT something')
8690
end
8791
end
92+
8893
describe 'with connect_settings' do
8994
let(:attributes) { { connect_settings: { 'PGHOST' => '127.0.0.1' } } }
9095

spec/unit/puppet/type/postgresql_conn_validator.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@
3434
end
3535
end
3636
end
37+
3738
describe 'connect_settings' do
3839
it 'accepts a hash' do
3940
expect { described_class.new(name: 'test', connect_settings: { 'PGPASSWORD' => 'test1' }) }.not_to raise_error
4041
end
4142
end
43+
4244
describe 'port' do
4345
it 'does not accept a word' do
4446
expect { described_class.new(name: 'test', port: 'test') }.to raise_error Puppet::Error

spec/unit/puppet/type/postgresql_psql_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,25 @@
5454

5555
it { is_expected.to eq('psql') }
5656
end
57+
5758
context 'default value: [:psql_user]' do
5859
subject { super()[:psql_user] }
5960

6061
it { is_expected.to eq('postgres') }
6162
end
63+
6264
context 'default value: [:psql_group]' do
6365
subject { super()[:psql_group] }
6466

6567
it { is_expected.to eq('postgres') }
6668
end
69+
6770
context 'default value: [:cwd]' do
6871
subject { super()[:cwd] }
6972

7073
it { is_expected.to eq('/tmp') }
7174
end
75+
7276
context 'default value: #refreshonly?' do
7377
subject { super().refreshonly? }
7478

@@ -135,6 +139,7 @@
135139
context 'not refreshing'
136140
it { expect(subject.should_run_sql).to be_falsey }
137141
end
142+
138143
context "refreshonly => #{refreshonly.inspect}" do
139144
let(:attributes) do
140145
{ refreshonly: refreshonly }
@@ -154,6 +159,7 @@
154159
context 'not refreshing'
155160
it { expect(subject.should_run_sql).to be_truthy }
156161
end
162+
157163
context "refreshonly => #{refreshonly.inspect}" do
158164
let(:attributes) do
159165
{ refreshonly: refreshonly }
@@ -177,6 +183,7 @@
177183
context 'not refreshing'
178184
it { expect(subject.should_run_sql).to be_falsey }
179185
end
186+
180187
context "refreshonly => #{refreshonly.inspect}" do
181188
let(:attributes) do
182189
{ refreshonly: refreshonly, unless: 'SELECT something' }
@@ -196,6 +203,7 @@
196203
context 'not refreshing'
197204
it { expect(subject.should_run_sql).to be_falsey }
198205
end
206+
199207
context "refreshonly => #{refreshonly.inspect}" do
200208
let(:attributes) do
201209
{ refreshonly: refreshonly, unless: 'SELECT something' }
@@ -219,6 +227,7 @@
219227
context 'not refreshing'
220228
it { expect(subject.should_run_sql).to be_falsey }
221229
end
230+
222231
context "refreshonly => #{refreshonly.inspect}" do
223232
let(:attributes) do
224233
{ refreshonly: refreshonly, unless: 'SELECT something' }
@@ -238,6 +247,7 @@
238247
context 'not refreshing'
239248
it { expect(subject.should_run_sql).to be_truthy }
240249
end
250+
241251
context "refreshonly => #{refreshonly.inspect}" do
242252
let(:attributes) do
243253
{ refreshonly: refreshonly, unless: 'SELECT something' }

0 commit comments

Comments
 (0)