Skip to content

Commit c186091

Browse files
committed
Addressing Rubocop errors
1 parent 575003f commit c186091

File tree

12 files changed

+11
-26
lines changed

12 files changed

+11
-26
lines changed

spec/acceptance/db_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
require 'spec_helper_acceptance'
22

33
describe 'postgresql::server::db', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
4-
# rubocop:disable RSpec/ExampleLength
5-
# rubocop:disable RSpec/MultipleExpectations
64
# rubocop:disable Metrics/LineLength
75
it 'creates a database' do
86
begin

spec/acceptance/postgresql_conn_validator_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class { 'postgresql::server':
2222
end
2323

2424
context 'local connection' do
25-
it 'validates successfully with defaults' do # rubocop:disable RSpec/ExampleLength
25+
it 'validates successfully with defaults' do
2626
pp = <<-MANIFEST
2727
#{install_pp}->
2828
postgresql_conn_validator { 'validate this':
@@ -38,7 +38,7 @@ class { 'postgresql::server':
3838
apply_manifest(pp, catch_changes: true)
3939
end
4040

41-
it 'works with connect settings hash' do # rubocop:disable RSpec/ExampleLength
41+
it 'works with connect settings hash' do
4242
pp = <<-MANIFEST
4343
#{install_pp}->
4444
postgresql_conn_validator { 'validate this':
@@ -57,7 +57,7 @@ class { 'postgresql::server':
5757
apply_manifest(pp, catch_changes: true)
5858
end
5959

60-
it 'fails gracefully' do # rubocop:disable RSpec/ExampleLength
60+
it 'fails gracefully' do
6161
pp = <<-MANIFEST
6262
#{install_pp}->
6363
postgresql_conn_validator { 'validate this':

spec/acceptance/postgresql_psql_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class { 'postgresql::server': } ->
135135
end
136136

137137
context 'with secure password passing by environment' do
138-
it 'runs SQL that contanins password passed by environment' do # rubocop:disable RSpec/ExampleLength
138+
it 'runs SQL that contanins password passed by environment' do
139139
select = "select \\'$PASS_TO_EMBED\\'"
140140
pp = <<-MANIFEST.unindent
141141
class { 'postgresql::server': } ->
@@ -151,7 +151,7 @@ class { 'postgresql::server': } ->
151151
apply_manifest(pp, catch_failures: true)
152152
apply_manifest(pp, expect_changes: false)
153153
end
154-
it 'runs SQL that contanins password passed by environment in check' do # rubocop:disable RSpec/ExampleLength
154+
it 'runs SQL that contanins password passed by environment in check' do
155155
select = "select 1 where \\'$PASS_TO_EMBED\\'=\\'passwD\\'"
156156
pp = <<-MANIFEST.unindent
157157
class { 'postgresql::server': } ->

spec/acceptance/server/grant_role_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,6 @@ class { 'postgresql::server': }
210210
MANIFEST
211211
end
212212

213-
# rubocop:disable RSpec/ExampleLength
214-
# rubocop:disable RSpec/MultipleExpectations
215213
it 'grants a role to a user' do
216214
begin
217215
apply_manifest(pp_one, catch_failures: true)

spec/acceptance/server/grant_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
require 'spec_helper_acceptance'
22

33
describe 'postgresql::server::grant:', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
4-
# rubocop:disable RSpec/ExampleLength
5-
# rubocop:disable RSpec/MultipleExpectations
64
let(:db) { 'grant_priv_test' }
75
let(:owner) { 'psql_grant_priv_owner' }
86
let(:user) { 'psql_grant_priv_tester' }

spec/acceptance/server/reassign_owned_by_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ class { 'postgresql::server': }
102102
MANIFEST
103103
end
104104

105-
# rubocop:disable RSpec/ExampleLength
106-
# rubocop:disable RSpec/MultipleExpectations
107105
it 'reassigns all objects to new_owner' do
108106
begin
109107
# postgres version

spec/acceptance/server/schema_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ class { 'postgresql::server': }
5353
MANIFEST
5454
end
5555

56-
# rubocop:disable RSpec/ExampleLength
57-
# rubocop:disable RSpec/MultipleExpectations
5856
it 'creates a schema for a user' do
5957
begin
6058
apply_manifest(pp, catch_failures: true)

spec/unit/classes/lib/devel_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
}
7676
end
7777

78-
it 'fails to compile' do # rubocop:disable RSpec/MultipleExpectations
78+
it 'fails to compile' do
7979
expect {
8080
is_expected.to compile
8181
}.to raise_error(%r{is not supported})

spec/unit/classes/server/contrib_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
}
4747
end
4848

49-
it 'fails to compile' do # rubocop:disable RSpec/MultipleExpectations
49+
it 'fails to compile' do
5050
expect {
5151
is_expected.to compile
5252
}.to raise_error(%r{is not supported})

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
end
5858

5959
it 'tries the correct number of times' do
60-
expect(provider.validator).to receive(:execute_command).exactly(3).times # rubocop:disable RSpec/MessageSpies
60+
expect(provider.validator).to receive(:execute_command).exactly(3).times
6161

6262
provider.validator.attempt_connection(sleep_length, tries)
6363
end

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
require 'spec_helper'
22

33
describe Puppet::Type.type(:postgresql_psql).provider(:ruby) do
4-
# rubocop:disable RSpec/MessageSpies
54
let(:name) { 'rspec psql test' }
65
let(:resource) do
76
Puppet::Type.type(:postgresql_psql).new({ name: name, provider: :ruby }.merge(attributes))
@@ -31,7 +30,7 @@
3130
}
3231
end
3332

34-
it 'executes with the given psql_path on the given DB' do # rubocop:disable RSpec/MultipleExpectations
33+
it 'executes with the given psql_path on the given DB' do
3534
expect(Dir).to receive(:chdir).with(attributes[:cwd]).and_yield
3635
expect(provider).to receive(:run_command).with([attributes[:psql_path],
3736
'-d', attributes[:db], '-t', '-c', '"SELECT \'something\' as \"Custom column\""'],
@@ -105,5 +104,4 @@
105104
provider.run_unless_sql_command('SELECT 1')
106105
end
107106
end
108-
# rubocop:enable RSpec/MessageSpies
109107
end

spec/unit/puppet/type/postgresql_psql_spec.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@
7474
end
7575
end
7676

77-
# rubocop:disable RSpec/MultipleExpectations
78-
# rubocop:disable RSpec/MessageSpies
7977
# rubocop:disable RSpec/NamedSubject
8078
# rubocop:disable RSpec/SubjectStub
8179
describe '#command' do
@@ -124,7 +122,6 @@
124122
end
125123
end
126124
end
127-
# rubocop:enable RSpec/MultipleExpectations
128125

129126
describe "#should_run_sql without 'unless'" do
130127
[true, :true].each do |refreshonly|
@@ -253,13 +250,13 @@
253250
describe '#refresh' do
254251
let(:attributes) { {} }
255252

256-
it 'syncs command property when command should run' do # rubocop:disable RSpec/MultipleExpectations
253+
it 'syncs command property when command should run' do
257254
expect(subject).to receive(:should_run_sql).with(true).and_return(true)
258255
expect(subject.property(:command)).to receive(:sync)
259256
subject.refresh
260257
end
261258

262-
it 'does not sync command property when command should not run' do # rubocop:disable RSpec/MultipleExpectations
259+
it 'does not sync command property when command should not run' do
263260
expect(subject).to receive(:should_run_sql).with(true).and_return(false)
264261
expect(subject.property(:command)).not_to receive(:sync)
265262
subject.refresh

0 commit comments

Comments
 (0)