Skip to content

Commit 96af506

Browse files
authored
Merge pull request #657 from HelenCampbell/dupRemoval
Remove duplicate deprecation warnings
2 parents 80daf16 + 02fc7f8 commit 96af506

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

lib/puppet/parser/functions/validate_absolute_path.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ module Puppet::Parser::Functions
2626
2727
ENDHEREDOC
2828

29-
function_deprecation([:puppet_3_type_check, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Absolute_path. There is further documentation for validate_legacy function in the README.'])
29+
# The deprecation function was being called twice, as validate_absolute_path calls is_absolute_path. I have removed it from here so it only calls deprecation once within is_absolute_path.
30+
# function_deprecation([:puppet_3_type_check, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Absolute_path. There is further documentation for validate_legacy function in the README.'])
3031

3132
require 'puppet/util'
3233

lib/puppet/parser/functions/validate_bool.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ module Puppet::Parser::Functions
1919
2020
ENDHEREDOC
2121

22-
function_deprecation([:puppet_3_type_check, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Bool. There is further documentation for validate_legacy function in the README.'])
22+
# The deprecation function was being called twice, as validate_bool calls is_bool. I have removed it from here so it only calls deprecation once within is_bool.
23+
# function_deprecation([:puppet_3_type_check, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Bool. There is further documentation for validate_legacy function in the README.'])
2324

2425
unless args.length > 0 then
2526
raise Puppet::ParseError, ("validate_bool(): wrong number of arguments (#{args.length}; must be > 0)")

spec/functions/validate_absolute_path_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77

88
# Checking for deprecation warning
99
it 'should display a single deprecation' do
10-
# called twice because validate_absolute_path calls is_absolute_path
1110
ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
12-
scope.expects(:warning).with(includes('This method is deprecated')).twice
11+
scope.expects(:warning).with(includes('This method is deprecated'))
1312
is_expected.to run.with_params('c:/')
1413
end
1514

spec/functions/validate_bool_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77

88
# Checking for deprecation warning
99
it 'should display a single deprecation' do
10-
#called twice, because validate_bool calls is_bool
1110
ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
12-
scope.expects(:warning).with(includes('This method is deprecated')).twice
11+
scope.expects(:warning).with(includes('This method is deprecated'))
1312
is_expected.to run.with_params(true)
1413
end
1514

0 commit comments

Comments
 (0)