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_hash_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'spec/functions/validate_hash_spec.rb') diff --git a/spec/functions/validate_hash_spec.rb b/spec/functions/validate_hash_spec.rb index 2e8e59f..7b118e2 100755 --- a/spec/functions/validate_hash_spec.rb +++ b/spec/functions/validate_hash_spec.rb @@ -5,6 +5,18 @@ describe 'validate_hash' 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) } + describe 'check for deprecation warning' 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({'key' => 'value'}) + end + end + describe 'valid inputs' do it { is_expected.to run.with_params({}) } it { is_expected.to run.with_params({'key' => 'value'}) } -- cgit v1.2.3