Skip to content

Commit ebec9de

Browse files
committed
Merge pull request #179 from lmello/function_pick_error_msg
enhanced the error message of pick function.
2 parents 079afa5 + 30e994f commit ebec9de

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/puppet/parser/functions/pick.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module Puppet::Parser::Functions
2121
args.delete(:undefined)
2222
args.delete("")
2323
if args[0].to_s.empty? then
24-
fail "Must provide non empty value."
24+
fail Puppet::ParseError, "pick(): must receive at last one non empty value"
2525
else
2626
return args[0]
2727
end

spec/unit/puppet/parser/functions/pick_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@
2929
end
3030

3131
it 'should error if no values are passed' do
32-
expect { scope.function_pick([]) }.to raise_error(Puppet::Error, /Must provide non empty value./)
32+
expect { scope.function_pick([]) }.to( raise_error(Puppet::ParseError, "pick(): must receive at last one non empty value"))
3333
end
3434
end

0 commit comments

Comments
 (0)