Skip to content

Commit c12e53c

Browse files
author
jordanbreen28
committed
(CONT-792) - Fix broken Acceptance
1 parent 83be16e commit c12e53c

File tree

2 files changed

+37
-14
lines changed

2 files changed

+37
-14
lines changed

.rubocop_todo.yml

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# This configuration was generated by
2+
# `rubocop --auto-gen-config`
3+
# on 2023-04-19 16:55:21 UTC using RuboCop version 1.48.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+
19
# Offense count: 15
210
# This cop supports unsafe autocorrection (--autocorrect-all).
311
Lint/BooleanSymbol:
@@ -13,16 +21,22 @@ Lint/ConstantDefinitionInBlock:
1321
Exclude:
1422
- 'spec/unit/puppet/provider/postgresql_replication_slot/ruby_spec.rb'
1523

24+
# Offense count: 1
25+
# This cop supports safe autocorrection (--autocorrect).
26+
Lint/RedundantCopEnableDirective:
27+
Exclude:
28+
- 'spec/unit/puppet/type/postgresql_psql_spec.rb'
29+
1630
# Offense count: 6
1731
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
1832
Metrics/AbcSize:
19-
Max: 49
33+
Max: 48
2034

21-
# Offense count: 8
35+
# Offense count: 7
2236
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
2337
# AllowedMethods: refine
2438
Metrics/BlockLength:
25-
Max: 121
39+
Max: 119
2640

2741
# Offense count: 3
2842
# Configuration parameters: AllowedMethods, AllowedPatterns.
@@ -32,7 +46,7 @@ Metrics/CyclomaticComplexity:
3246
# Offense count: 6
3347
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
3448
Metrics/MethodLength:
35-
Max: 31
49+
Max: 29
3650

3751
# Offense count: 1
3852
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
@@ -59,8 +73,7 @@ Naming/HeredocDelimiterNaming:
5973
- 'spec/defines/server/default_privileges_spec.rb'
6074
- 'spec/defines/server/grant_spec.rb'
6175

62-
63-
# Offense count: 104
76+
# Offense count: 101
6477
# Configuration parameters: Prefixes, AllowedPatterns.
6578
# Prefixes: when, with, without
6679
RSpec/ContextWording:
@@ -76,7 +89,6 @@ RSpec/DescribeClass:
7689
RSpec/ExampleLength:
7790
Max: 53
7891

79-
8092
# Offense count: 3
8193
RSpec/ExpectInHook:
8294
Exclude:
@@ -96,10 +108,6 @@ RSpec/FilePath:
96108
- 'spec/defines/server/instance/service.rb'
97109
- 'spec/unit/puppet/type/postgresql_conn_validator.rb'
98110

99-
100-
RSpec/NamedSubject:
101-
Enabled: false
102-
103111
# Offense count: 2
104112
RSpec/LeakyConstantDeclaration:
105113
Exclude:
@@ -119,6 +127,12 @@ RSpec/MultipleExpectations:
119127
RSpec/MultipleMemoizedHelpers:
120128
Max: 18
121129

130+
# Offense count: 208
131+
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
132+
# SupportedStyles: always, named_only
133+
RSpec/NamedSubject:
134+
Enabled: false
135+
122136
# Offense count: 1
123137
# Configuration parameters: AllowedGroups.
124138
RSpec/NestedGroups:
@@ -160,6 +174,15 @@ Style/ClassAndModuleChildren:
160174
Exclude:
161175
- 'lib/puppet/util/postgresql_validator.rb'
162176

177+
# Offense count: 3
178+
# This cop supports unsafe autocorrection (--autocorrect-all).
179+
# Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
180+
# SupportedStyles: predicate, comparison
181+
Style/NumericPredicate:
182+
Exclude:
183+
- 'spec/**/*'
184+
- 'lib/puppet/type/postgresql_psql.rb'
185+
163186
# Offense count: 2
164187
# Configuration parameters: AllowedMethods.
165188
# AllowedMethods: respond_to_missing?

lib/puppet/type/postgresql_psql.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def retrieve
2323

2424
def sync
2525
output, status = provider.run_sql_command(value)
26-
raise("Error executing SQL; psql returned #{status}: '#{output}'") unless status.zero?
26+
raise("Error executing SQL; psql returned #{status}: '#{output}'") unless status.to_i.zero?
2727
end
2828
end
2929

@@ -38,7 +38,7 @@ def sync
3838
# Return true if a matching row is found
3939
def matches(value)
4040
output, status = provider.run_unless_sql_command(value)
41-
fail("Error evaluating 'unless' clause, returned #{status}: '#{output}'") unless status.zero? # rubocop:disable Style/SignalException
41+
fail("Error evaluating 'unless' clause, returned #{status}: '#{output}'") unless status.to_i.zero? # rubocop:disable Style/SignalException
4242

4343
result_count = output.strip.to_i
4444
debug("Found #{result_count} row(s) executing 'unless' clause")
@@ -59,7 +59,7 @@ def matches(value)
5959
output, status = provider.run_unless_sql_command(value)
6060
status = output.exitcode if status.nil?
6161

62-
raise("Error evaluating 'onlyif' clause, returned #{status}: '#{output}'") unless status.zero?
62+
raise("Error evaluating 'onlyif' clause, returned #{status}: '#{output}'") unless status.to_i.zero?
6363

6464
result_count = output.strip.to_i
6565
debug("Found #{result_count} row(s) executing 'onlyif' clause")

0 commit comments

Comments
 (0)