Skip to content

Remove duplicate deprecation warnings #657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/puppet/parser/functions/validate_absolute_path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ module Puppet::Parser::Functions

ENDHEREDOC

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.'])
# 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.
# 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.'])

require 'puppet/util'

Expand Down
3 changes: 2 additions & 1 deletion lib/puppet/parser/functions/validate_bool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ module Puppet::Parser::Functions

ENDHEREDOC

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.'])
# 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.
# 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.'])

unless args.length > 0 then
raise Puppet::ParseError, ("validate_bool(): wrong number of arguments (#{args.length}; must be > 0)")
Expand Down
3 changes: 1 addition & 2 deletions spec/functions/validate_absolute_path_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@

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

Expand Down
3 changes: 1 addition & 2 deletions spec/functions/validate_bool_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@

# Checking for deprecation warning
it 'should display a single deprecation' do
#called twice, because validate_bool calls is_bool
ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
scope.expects(:warning).with(includes('This method is deprecated')).twice
scope.expects(:warning).with(includes('This method is deprecated'))
is_expected.to run.with_params(true)
end

Expand Down