summaryrefslogtreecommitdiff
path: root/spec/unit/puppet/parser/functions/has_element_spec.rb
AgeCommit message (Collapse)Author
2013-02-14(#19272) Add has_element() functionJoshua Hoblitt
It is exceptionally difficult to determine if an array contains an element matching a specific value without an iteration or loop construct. This function is the Puppet equivalent of Array.includes?(foo) in Ruby. The implementation is a verbatim copy of has_key() with the minor modifications needed to support arrays instead of hashes.