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