diff options
author | Adam Jacob <adam@opscode.com> | 2011-04-05 11:30:39 -0700 |
---|---|---|
committer | Daniel DeLeo <dan@opscode.com> | 2011-04-06 14:16:04 -0700 |
commit | 2a5d20cce54cf1a0753cc86e629798ac34e92069 (patch) | |
tree | 67a71f13fb92b638727069ae273ccedec89c5b70 /chef | |
parent | 8265ed26287f7e7889099d93fb0bd918da218c72 (diff) | |
download | chef-2a5d20cce54cf1a0753cc86e629798ac34e92069.tar.gz |
Fixing specs for cron provider
Diffstat (limited to 'chef')
-rw-r--r-- | chef/lib/chef/provider/cron.rb | 4 | ||||
-rw-r--r-- | chef/spec/unit/provider/cron_spec.rb | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/chef/lib/chef/provider/cron.rb b/chef/lib/chef/provider/cron.rb index e0830f79ec..08c214b768 100644 --- a/chef/lib/chef/provider/cron.rb +++ b/chef/lib/chef/provider/cron.rb @@ -132,7 +132,7 @@ class Chef status = popen4("crontab -u #{@new_resource.user} -", :waitlast => true) do |pid, stdin, stdout, stderr| crontab.each_line { |line| stdin.puts "#{line}" } end - Chef::Log.info("#{@new_resource} updated crontab entry'") + Chef::Log.info("#{@new_resource} updated crontab entry") @new_resource.updated_by_last_action(true) else unless @cron_empty @@ -146,7 +146,7 @@ class Chef status = popen4("crontab -u #{@new_resource.user} -", :waitlast => true) do |pid, stdin, stdout, stderr| crontab.each_line { |line| stdin.puts "#{line}" } end - Chef::Log.info("#{@new_resource} added crontab entry'") + Chef::Log.info("#{@new_resource} added crontab entry") @new_resource.updated_by_last_action(true) end end diff --git a/chef/spec/unit/provider/cron_spec.rb b/chef/spec/unit/provider/cron_spec.rb index 0437365bfb..e32916dd9d 100644 --- a/chef/spec/unit/provider/cron_spec.rb +++ b/chef/spec/unit/provider/cron_spec.rb @@ -112,7 +112,7 @@ CRON * 10 * * * /bin/false CRONTAB @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) - Chef::Log.should_receive(:info).with("Added cron '#{@new_resource.name}'") + Chef::Log.should_receive(:info).with("cron[cronhole some stuff] added crontab entry") @provider.action_create end @@ -130,7 +130,7 @@ CRON it "should create the cron entry even if cron is empty" do @provider.cron_empty=true @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) - Chef::Log.should_receive(:info).with("Added cron '#{@new_resource.name}'") + Chef::Log.should_receive(:info).with("cron[cronhole some stuff] added crontab entry") @provider.action_create end @@ -138,7 +138,7 @@ CRON @provider.current_resource = @current_resource @provider.cron_exists=true @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) - Chef::Log.should_receive(:info).with("Updated cron '#{@new_resource.name}'") + Chef::Log.should_receive(:info).with("cron[cronhole some stuff] updated crontab entry") @provider.should_receive(:compare_cron).once.and_return(true) @provider.action_create end @@ -168,7 +168,7 @@ MAILTO=warn@example.com 30 * * * * /bin/true CRON @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) - Chef::Log.should_receive(:info).with("Updated cron '#{@new_resource.name}'") + Chef::Log.should_receive(:info).with("cron[cronhole some stuff] updated crontab entry") @provider.cron_exists = true @provider.should_receive(:compare_cron).once.and_return(true) @provider.action_create @@ -198,7 +198,7 @@ CRON 30 * * * * /bin/true CRON provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) - Chef::Log.should_receive(:info).with("Updated cron 'lobster rage'") + Chef::Log.should_receive(:info).with("cron[lobster rage] updated crontab entry") provider.cron_exists = true provider.should_receive(:compare_cron).once.and_return(true) provider.action_create @@ -219,7 +219,7 @@ CRON CRON @provider.cron_exists=true @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status) - Chef::Log.should_receive(:debug).with("Deleted cron '#{@new_resource.name}'") + Chef::Log.should_receive(:info).with("#{@new_resource} deleted crontab entry") @provider.action_delete end |