Permalink
Browse files

Added environment to cron resource.

  • Loading branch information...
iafonov committed Nov 29, 2011
1 parent 294e9f7 commit 96ef7d770a7d898fdce097c7fda9039abf7bf485
Showing with 14 additions and 0 deletions.
  1. +8 −0 chef/lib/chef/resource/cron.rb
  2. +6 −0 chef/spec/unit/resource/cron_spec.rb
@@ -172,6 +172,14 @@ def user(arg=nil)
:kind_of => String
)
end
+
+ def environment(arg=nil)
+ set_or_return(
+ :environment,
+ arg,
+ :kind_of => Hash
+ )
+ end
private
@@ -98,6 +98,12 @@
@resource.shell.should eql("/bin/zsh")
end
+ it "should allow you to specify environment variables hash" do
+ env = {"TEST" => "LOL"}
+ @resource.environment env
+ @resource.environment.should eql(env)
+ end
+
it "should allow * for all time and date values" do
[ "minute", "hour", "day", "month", "weekday" ].each do |x|
@resource.send(x, "*").should eql("*")

0 comments on commit 96ef7d7

Please sign in to comment.