4 describe "the is_array function" do
6 Puppet::Parser::Functions.autoloader.loadall
10 @scope = Puppet::Parser::Scope.new
14 Puppet::Parser::Functions.function("is_array").should == "function_is_array"
17 it "should raise a ParseError if there is less than 1 arguments" do
18 lambda { @scope.function_is_array([]) }.should( raise_error(Puppet::ParseError))
21 it "should return true if passed an array" do
22 result = @scope.function_is_array([[1,2,3]])
23 result.should(eq(true))
26 it "should return false if passed a hash" do
27 result = @scope.function_is_array([{'a'=>1}])
28 result.should(eq(false))
31 it "should return false if passed a string" do
32 result = @scope.function_is_array(["asdf"])
33 result.should(eq(false))