4 describe "the sort function" do
6 Puppet::Parser::Functions.autoloader.loadall
10 @scope = Puppet::Parser::Scope.new
14 Puppet::Parser::Functions.function("sort").should == "function_sort"
17 it "should raise a ParseError if there is not 1 arguments" do
18 lambda { @scope.function_sort(['','']) }.should( raise_error(Puppet::ParseError))
21 it "should sort an array" do
22 result = @scope.function_sort([["a","c","b"]])
23 result.should(eq(['a','b','c']))
26 it "should sort a string" do
27 result = @scope.function_sort(["acb"])
28 result.should(eq('abc'))