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