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