4 describe "the member function" do
6 Puppet::Parser::Functions.autoloader.loadall
10 @scope = Puppet::Parser::Scope.new
14 Puppet::Parser::Functions.function("member").should == "function_member"
17 it "should raise a ParseError if there is less than 1 arguments" do
18 lambda { @scope.function_member([]) }.should( raise_error(Puppet::ParseError))
21 it "should return true if a member is in an array" do
22 result = @scope.function_member([["a","b","c"], "a"])
23 result.should(eq(true))
26 it "should return false if a member is not in an array" do
27 result = @scope.function_member([["a","b","c"], "d"])
28 result.should(eq(false))