summaryrefslogtreecommitdiff
path: root/spec/unit/parser/functions/type_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/parser/functions/type_spec.rb')
-rw-r--r--spec/unit/parser/functions/type_spec.rb22
1 files changed, 16 insertions, 6 deletions
diff --git a/spec/unit/parser/functions/type_spec.rb b/spec/unit/parser/functions/type_spec.rb
index 36c3823..53071f3 100644
--- a/spec/unit/parser/functions/type_spec.rb
+++ b/spec/unit/parser/functions/type_spec.rb
@@ -18,19 +18,29 @@ describe "the type function" do
lambda { @scope.function_type([]) }.should( raise_error(Puppet::ParseError))
end
- it "should return String when given a string" do
+ it "should return string when given a string" do
result = @scope.function_type(["aaabbbbcccc"])
- result.should(eq('String'))
+ result.should(eq('string'))
end
- it "should return Array when given an array" do
+ it "should return array when given an array" do
result = @scope.function_type([["aaabbbbcccc","asdf"]])
- result.should(eq('Array'))
+ result.should(eq('array'))
end
- it "should return Hash when given a hash" do
+ it "should return hash when given a hash" do
result = @scope.function_type([{"a"=>1,"b"=>2}])
- result.should(eq('Hash'))
+ result.should(eq('hash'))
+ end
+
+ it "should return integer when given an integer" do
+ result = @scope.function_type(["1"])
+ result.should(eq('integer'))
+ end
+
+ it "should return float when given a float" do
+ result = @scope.function_type(["1.34"])
+ result.should(eq('float'))
end
end