4 describe "the delete function" do
6 Puppet::Parser::Functions.autoloader.loadall
10 @scope = Puppet::Parser::Scope.new
14 Puppet::Parser::Functions.function("delete").should == "function_delete"
17 it "should raise a ParseError if there is less than 1 arguments" do
18 lambda { @scope.function_delete([]) }.should( raise_error(Puppet::ParseError))
21 it "should delete an item from an array" do
22 result = @scope.function_delete([['a','b','c'],'b'])
23 result.should(eq(['a','c']))