diff options
-rw-r--r-- | lib/puppet/parser/functions/pick.rb | 2 | ||||
-rw-r--r-- | spec/unit/puppet/parser/functions/pick_spec.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/puppet/parser/functions/pick.rb b/lib/puppet/parser/functions/pick.rb index cbc0300..e9e5d66 100644 --- a/lib/puppet/parser/functions/pick.rb +++ b/lib/puppet/parser/functions/pick.rb @@ -21,7 +21,7 @@ EOS args.delete(:undefined) args.delete("") if args[0].to_s.empty? then - fail "Must provide non empty value." + fail Puppet::ParseError, "pick(): must receive at last one non empty value" else return args[0] end diff --git a/spec/unit/puppet/parser/functions/pick_spec.rb b/spec/unit/puppet/parser/functions/pick_spec.rb index 761db6b..d2b275f 100644 --- a/spec/unit/puppet/parser/functions/pick_spec.rb +++ b/spec/unit/puppet/parser/functions/pick_spec.rb @@ -29,6 +29,6 @@ describe "the pick function" do end it 'should error if no values are passed' do - expect { scope.function_pick([]) }.to raise_error(Puppet::Error, /Must provide non empty value./) + expect { scope.function_pick([]) }.to( raise_error(Puppet::ParseError, "pick(): must receive at last one non empty value")) end end |