From 055dbb611a60f5d8a6c184e12f8da0b85b8971dd Mon Sep 17 00:00:00 2001 From: Helen Campbell Date: Wed, 21 Sep 2016 17:28:04 +0100 Subject: Add deprecation warnings to remaining validates --- spec/functions/validate_slength_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'spec/functions/validate_slength_spec.rb') diff --git a/spec/functions/validate_slength_spec.rb b/spec/functions/validate_slength_spec.rb index 5a8fa6a..2ea253c 100755 --- a/spec/functions/validate_slength_spec.rb +++ b/spec/functions/validate_slength_spec.rb @@ -1,6 +1,17 @@ require 'spec_helper' describe 'validate_slength' do + after(:context) do + ENV.delete('STDLIB_LOG_DEPRECATIONS') + end + + # Checking for deprecation warning + it 'should display a single deprecation' do + ENV['STDLIB_LOG_DEPRECATIONS'] = "true" + scope.expects(:warning).with(includes('This method is deprecated')) + is_expected.to run.with_params('1234567890', 10) + end + describe 'signature validation' do it { is_expected.not_to eq(nil) } it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) } -- cgit v1.2.3