4 describe "the hash function" do
6 Puppet::Parser::Functions.autoloader.loadall
10 @scope = Puppet::Parser::Scope.new
14 Puppet::Parser::Functions.function("hash").should == "function_hash"
17 it "should raise a ParseError if there is less than 1 arguments" do
18 lambda { @scope.function_hash([]) }.should( raise_error(Puppet::ParseError))
21 it "should convert an array to a hash" do
22 result = @scope.function_hash([['a',1,'b',2,'c',3]])
23 result.should(eq({'a'=>1,'b'=>2,'c'=>3}))