Skip to content

Commit 2d9978f

Browse files
committed
rubocop fixes
1 parent c3b06d6 commit 2d9978f

File tree

6 files changed

+96
-110
lines changed

6 files changed

+96
-110
lines changed

lib/puppet/functions/postgresql/postgresql_acls_to_resources_hash.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@
3939
repeated_param 'Any', :args
4040
end
4141

42-
4342
def default_impl(*args)
44-
4543
func_name = 'postgresql_acls_to_resources_hash()'
4644

4745
if args.size != 3
@@ -97,6 +95,5 @@ def default_impl(*args)
9795
resources["postgresql class generated rule #{id} #{index}"] = resource
9896
end
9997
resources
100-
10198
end
10299
end

lib/puppet/functions/postgresql/postgresql_escape.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@
3030
repeated_param 'Any', :args
3131
end
3232

33-
3433
def default_impl(*args)
35-
36-
3734
if args.size != 1
3835
raise(Puppet::ParseError, 'postgresql_escape(): Wrong number of arguments ' \
3936
"given (#{args.size} for 1)")
@@ -51,6 +48,5 @@ def default_impl(*args)
5148
retval = "$#{escape}$#{password}$#{escape}$"
5249
end
5350
retval
54-
5551
end
5652
end

lib/puppet/functions/postgresql/postgresql_password.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@
3131
repeated_param 'Any', :args
3232
end
3333

34-
3534
def default_impl(*args)
36-
37-
3835
if args.size != 2
3936
raise(Puppet::ParseError, 'postgresql_password(): Wrong number of arguments ' \
4037
"given (#{args.size} for 2)")
@@ -44,6 +41,5 @@ def default_impl(*args)
4441
password = args[1]
4542

4643
'md5' + Digest::MD5.hexdigest(password.to_s + username.to_s)
47-
4844
end
4945
end

spec/functions/postgresql_postgresql_acls_to_resources_hash_spec.rb

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,36 @@
55
# case that we can autogenerate. You should add more examples below!
66
it { is_expected.not_to eq(nil) }
77

8-
#################################
9-
# Below are some example test cases. You may uncomment and modify them to match
10-
# your needs. Notice that they all expect the base error class of `StandardError`.
11-
# This is because the autogenerated function uses an untyped array for parameters
12-
# and relies on your implementation to do the validation. As you convert your
13-
# function to proper dispatches and typed signatures, you should change the
14-
# expected error of the argument validation examples to `ArgumentError`.
15-
#
16-
# Other error types you might encounter include
17-
#
18-
# * StandardError
19-
# * ArgumentError
20-
# * Puppet::ParseError
21-
#
22-
# Read more about writing function unit tests at https://rspec-puppet.com/documentation/functions/
23-
#
24-
# it 'raises an error if called with no argument' do
25-
# is_expected.to run.with_params.and_raise_error(StandardError)
26-
# end
27-
#
28-
# it 'raises an error if there is more than 1 arguments' do
29-
# is_expected.to run.with_params({ 'foo' => 1 }, 'bar' => 2).and_raise_error(StandardError)
30-
# end
31-
#
32-
# it 'raises an error if argument is not the proper type' do
33-
# is_expected.to run.with_params('foo').and_raise_error(StandardError)
34-
# end
35-
#
36-
# it 'returns the proper output' do
37-
# is_expected.to run.with_params(123).and_return('the expected output')
38-
# end
39-
#################################
40-
8+
#################################
9+
# Below are some example test cases. You may uncomment and modify them to match
10+
# your needs. Notice that they all expect the base error class of `StandardError`.
11+
# This is because the autogenerated function uses an untyped array for parameters
12+
# and relies on your implementation to do the validation. As you convert your
13+
# function to proper dispatches and typed signatures, you should change the
14+
# expected error of the argument validation examples to `ArgumentError`.
15+
#
16+
# Other error types you might encounter include
17+
#
18+
# * StandardError
19+
# * ArgumentError
20+
# * Puppet::ParseError
21+
#
22+
# Read more about writing function unit tests at https://rspec-puppet.com/documentation/functions/
23+
#
24+
# it 'raises an error if called with no argument' do
25+
# is_expected.to run.with_params.and_raise_error(StandardError)
26+
# end
27+
#
28+
# it 'raises an error if there is more than 1 arguments' do
29+
# is_expected.to run.with_params({ 'foo' => 1 }, 'bar' => 2).and_raise_error(StandardError)
30+
# end
31+
#
32+
# it 'raises an error if argument is not the proper type' do
33+
# is_expected.to run.with_params('foo').and_raise_error(StandardError)
34+
# end
35+
#
36+
# it 'returns the proper output' do
37+
# is_expected.to run.with_params(123).and_return('the expected output')
38+
# end
39+
#################################
4140
end

spec/functions/postgresql_postgresql_escape_spec.rb

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,36 @@
55
# case that we can autogenerate. You should add more examples below!
66
it { is_expected.not_to eq(nil) }
77

8-
#################################
9-
# Below are some example test cases. You may uncomment and modify them to match
10-
# your needs. Notice that they all expect the base error class of `StandardError`.
11-
# This is because the autogenerated function uses an untyped array for parameters
12-
# and relies on your implementation to do the validation. As you convert your
13-
# function to proper dispatches and typed signatures, you should change the
14-
# expected error of the argument validation examples to `ArgumentError`.
15-
#
16-
# Other error types you might encounter include
17-
#
18-
# * StandardError
19-
# * ArgumentError
20-
# * Puppet::ParseError
21-
#
22-
# Read more about writing function unit tests at https://rspec-puppet.com/documentation/functions/
23-
#
24-
# it 'raises an error if called with no argument' do
25-
# is_expected.to run.with_params.and_raise_error(StandardError)
26-
# end
27-
#
28-
# it 'raises an error if there is more than 1 arguments' do
29-
# is_expected.to run.with_params({ 'foo' => 1 }, 'bar' => 2).and_raise_error(StandardError)
30-
# end
31-
#
32-
# it 'raises an error if argument is not the proper type' do
33-
# is_expected.to run.with_params('foo').and_raise_error(StandardError)
34-
# end
35-
#
36-
# it 'returns the proper output' do
37-
# is_expected.to run.with_params(123).and_return('the expected output')
38-
# end
39-
#################################
40-
8+
#################################
9+
# Below are some example test cases. You may uncomment and modify them to match
10+
# your needs. Notice that they all expect the base error class of `StandardError`.
11+
# This is because the autogenerated function uses an untyped array for parameters
12+
# and relies on your implementation to do the validation. As you convert your
13+
# function to proper dispatches and typed signatures, you should change the
14+
# expected error of the argument validation examples to `ArgumentError`.
15+
#
16+
# Other error types you might encounter include
17+
#
18+
# * StandardError
19+
# * ArgumentError
20+
# * Puppet::ParseError
21+
#
22+
# Read more about writing function unit tests at https://rspec-puppet.com/documentation/functions/
23+
#
24+
# it 'raises an error if called with no argument' do
25+
# is_expected.to run.with_params.and_raise_error(StandardError)
26+
# end
27+
#
28+
# it 'raises an error if there is more than 1 arguments' do
29+
# is_expected.to run.with_params({ 'foo' => 1 }, 'bar' => 2).and_raise_error(StandardError)
30+
# end
31+
#
32+
# it 'raises an error if argument is not the proper type' do
33+
# is_expected.to run.with_params('foo').and_raise_error(StandardError)
34+
# end
35+
#
36+
# it 'returns the proper output' do
37+
# is_expected.to run.with_params(123).and_return('the expected output')
38+
# end
39+
#################################
4140
end

spec/functions/postgresql_postgresql_password_spec.rb

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,36 @@
55
# case that we can autogenerate. You should add more examples below!
66
it { is_expected.not_to eq(nil) }
77

8-
#################################
9-
# Below are some example test cases. You may uncomment and modify them to match
10-
# your needs. Notice that they all expect the base error class of `StandardError`.
11-
# This is because the autogenerated function uses an untyped array for parameters
12-
# and relies on your implementation to do the validation. As you convert your
13-
# function to proper dispatches and typed signatures, you should change the
14-
# expected error of the argument validation examples to `ArgumentError`.
15-
#
16-
# Other error types you might encounter include
17-
#
18-
# * StandardError
19-
# * ArgumentError
20-
# * Puppet::ParseError
21-
#
22-
# Read more about writing function unit tests at https://rspec-puppet.com/documentation/functions/
23-
#
24-
# it 'raises an error if called with no argument' do
25-
# is_expected.to run.with_params.and_raise_error(StandardError)
26-
# end
27-
#
28-
# it 'raises an error if there is more than 1 arguments' do
29-
# is_expected.to run.with_params({ 'foo' => 1 }, 'bar' => 2).and_raise_error(StandardError)
30-
# end
31-
#
32-
# it 'raises an error if argument is not the proper type' do
33-
# is_expected.to run.with_params('foo').and_raise_error(StandardError)
34-
# end
35-
#
36-
# it 'returns the proper output' do
37-
# is_expected.to run.with_params(123).and_return('the expected output')
38-
# end
39-
#################################
40-
8+
#################################
9+
# Below are some example test cases. You may uncomment and modify them to match
10+
# your needs. Notice that they all expect the base error class of `StandardError`.
11+
# This is because the autogenerated function uses an untyped array for parameters
12+
# and relies on your implementation to do the validation. As you convert your
13+
# function to proper dispatches and typed signatures, you should change the
14+
# expected error of the argument validation examples to `ArgumentError`.
15+
#
16+
# Other error types you might encounter include
17+
#
18+
# * StandardError
19+
# * ArgumentError
20+
# * Puppet::ParseError
21+
#
22+
# Read more about writing function unit tests at https://rspec-puppet.com/documentation/functions/
23+
#
24+
# it 'raises an error if called with no argument' do
25+
# is_expected.to run.with_params.and_raise_error(StandardError)
26+
# end
27+
#
28+
# it 'raises an error if there is more than 1 arguments' do
29+
# is_expected.to run.with_params({ 'foo' => 1 }, 'bar' => 2).and_raise_error(StandardError)
30+
# end
31+
#
32+
# it 'raises an error if argument is not the proper type' do
33+
# is_expected.to run.with_params('foo').and_raise_error(StandardError)
34+
# end
35+
#
36+
# it 'returns the proper output' do
37+
# is_expected.to run.with_params(123).and_return('the expected output')
38+
# end
39+
#################################
4140
end

0 commit comments

Comments
 (0)