diff options
author | Nate Potter <ntpttr@gmail.com> | 2016-07-07 21:10:22 -0700 |
---|---|---|
committer | Nate Potter <ntpttr@gmail.com> | 2016-07-08 08:53:24 -0700 |
commit | a2f980d44d6703561769c5e0ef25a7f531417643 (patch) | |
tree | fd5118256340a58ed674911cf741169264af0589 /spec/functions/dig_spec.rb | |
parent | 098e82e694704222200d42f2dd4b50ca6d9999fa (diff) |
(MODULES-3568) Move dig to dig44 and deprecate dig
A new version of dig was introduced in Puppet 4.5.0 that
isn't compatible with the stdlib version of dig. To maintain
backwards compatibility and ensure that tests for stdlib aren't
broken, this patch renames dig to dig44 and adds a deprecation
warning to the stdlib dig function.
Diffstat (limited to 'spec/functions/dig_spec.rb')
-rw-r--r-- | spec/functions/dig_spec.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/functions/dig_spec.rb b/spec/functions/dig_spec.rb index 1c5d49d..ad16fdd 100644 --- a/spec/functions/dig_spec.rb +++ b/spec/functions/dig_spec.rb @@ -1,13 +1,13 @@ require 'spec_helper' describe 'dig' do - it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) } - it { is_expected.to run.with_params('bad', []).and_raise_error(Puppet::ParseError) } - it { is_expected.to run.with_params({}, 'bad').and_raise_error(Puppet::ParseError) } - it { is_expected.to run.with_params({}, []).and_return({}) } - it { is_expected.to run.with_params({"a" => "b"}, ["a"]).and_return("b") } - it { is_expected.to run.with_params({"a" => {"b" => "c"}}, ["a", "b"]).and_return("c") } - it { is_expected.to run.with_params({}, ["a", "b"], "d").and_return("d") } - it { is_expected.to run.with_params({"a" => false}, ["a"]).and_return(false) } + it "should exist" do + expect(Puppet::Parser::Functions.function("dig")).to eq("function_dig") + end + + it "should give a deprecation warning when called" do + scope.expects(:warning).with("dig() DEPRECATED: This function has been replaced in Puppet 4.5.0, please use dig44() for backwards compatibility or use the new version.") + scope.function_dig([{}, []]) + end end |