Skip to content

Commit

Permalink
Additional testing of input validation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristopher Kirkland committed Feb 26, 2014
1 parent 325f267 commit b0847b0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/unit/puppet/parser/functions/file_join_spec.rb
Expand Up @@ -12,6 +12,14 @@
lambda { scope.function_file_join([]) }.should( raise_error(Puppet::ParseError))
end

it "should raise a ParseError if there is more than 1 arguments" do
lambda { scope.function_file_join(['one','two']) }.should( raise_error(Puppet::ParseError))
end

it "should raise a ParseError if 1 argument, but it is not an array" do
lambda { scope.function_file_join(['one']) }.should( raise_error(Puppet::ParseError))
end

it "should join an array into a path" do
result = scope.function_file_join([["a","b","c"]])
result.should(eq("a/b/c"))
Expand Down

0 comments on commit b0847b0

Please sign in to comment.