4 describe "the upcase function" do
6 Puppet::Parser::Functions.autoloader.loadall
10 @scope = Puppet::Parser::Scope.new
14 Puppet::Parser::Functions.function("upcase").should == "function_upcase"
17 it "should raise a ParseError if there is less than 1 arguments" do
18 lambda { @scope.function_upcase([]) }.should( raise_error(Puppet::ParseError))
21 it "should upcase a string" do
22 result = @scope.function_upcase(["abc"])
23 result.should(eq('ABC'))
26 it "should do nothing if a string is already upcase" do
27 result = @scope.function_upcase(["ABC"])
28 result.should(eq('ABC'))