4 describe "the parsejson function" do
6 Puppet::Parser::Functions.autoloader.loadall
10 @scope = Puppet::Parser::Scope.new
14 Puppet::Parser::Functions.function("parsejson").should == "function_parsejson"
17 it "should raise a ParseError if there is less than 1 arguments" do
18 lambda { @scope.function_parsejson([]) }.should( raise_error(Puppet::ParseError))
21 it "should convert JSON to a data structure" do
25 result = @scope.function_parsejson([json])
26 result.should(eq(['aaa','bbb','ccc']))