diff options
author | Ken Barber <ken@bob.sh> | 2011-06-29 21:21:55 +0100 |
---|---|---|
committer | Ken Barber <ken@bob.sh> | 2011-06-29 21:21:55 +0100 |
commit | 790818116e953118ba9eab5e5bef6d63f7bbc1fa (patch) | |
tree | 3f56e221af94f481159a6848338c9f31d3b31e72 /lib/puppet/parser/functions/time.rb | |
parent | e071b05ab631f4b73fed7178c52d0416f7629cb8 (diff) |
Added tests for each function, fixing functions as we hit bugs.
Diffstat (limited to 'lib/puppet/parser/functions/time.rb')
-rw-r--r-- | lib/puppet/parser/functions/time.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/puppet/parser/functions/time.rb b/lib/puppet/parser/functions/time.rb index f7c1041..e1f5b6f 100644 --- a/lib/puppet/parser/functions/time.rb +++ b/lib/puppet/parser/functions/time.rb @@ -10,6 +10,11 @@ module Puppet::Parser::Functions # The Time Zone argument is optional ... time_zone = arguments[0] if arguments[0] + if (arguments.size != 0) and (arguments.size != 1) then + raise(Puppet::ParseError, "time(): Wrong number of arguments "+ + "given #{arguments.size} for 0 or 1") + end + time = Time.new # There is probably a better way to handle Time Zone ... |