diff options
Diffstat (limited to 'spec/unit/provider/log_spec.rb')
-rw-r--r-- | spec/unit/provider/log_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/unit/provider/log_spec.rb b/spec/unit/provider/log_spec.rb index 2e4f9c4e52..ce7b1af55a 100644 --- a/spec/unit/provider/log_spec.rb +++ b/spec/unit/provider/log_spec.rb @@ -72,4 +72,18 @@ describe Chef::Provider::Log::ChefLog do expect(Chef::Log).to receive(:info).with(log_str).and_return(true) provider.run_action(:write) end + + context "when count_log_resource_updates is passed in knife.rb" do + it "updates the resource count if count_log_resource_updates=true" do + Chef::Config[:count_log_resource_updates] = true + expect(new_resource).to receive(:updated_by_last_action) + provider.run_action(:write) + end + + it "doesn't update the resource count if count_log_resource_updates=false" do + Chef::Config[:count_log_resource_updates] = false + expect(new_resource).not_to receive(:updated_by_last_action) + provider.run_action(:write) + end + end end |