5 expect(Puppet::Parser::Functions.function("type")).to eq("function_type")
8 it "should give a deprecation warning when called" do
9 scope.expects(:warning).with("type() DEPRECATED: This function will cease to function on Puppet 4; please use type3x() before upgrading to puppet 4 for backwards-compatibility, or migrate to the new parser's typing system.")
10 scope.function_type(["aoeu"])
13 it "should return string when given a string" do
14 result = scope.function_type(["aaabbbbcccc"])
15 expect(result).to(eq('string'))
18 it "should return array when given an array" do
19 result = scope.function_type([["aaabbbbcccc","asdf"]])
20 expect(result).to(eq('array'))
23 it "should return hash when given a hash" do
24 result = scope.function_type([{"a"=>1,"b"=>2}])
25 expect(result).to(eq('hash'))
28 it "should return integer when given an integer" do
29 result = scope.function_type(["1"])
30 expect(result).to(eq('integer'))
33 it "should return float when given a float" do
34 result = scope.function_type(["1.34"])
35 expect(result).to(eq('float'))
38 it "should return boolean when given a boolean" do
39 result = scope.function_type([true])
40 expect(result).to(eq('boolean'))