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