summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/transaction/resource_harness_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/unit/transaction/resource_harness_spec.rb b/spec/unit/transaction/resource_harness_spec.rb
index f0c360e22..104c19e85 100755
--- a/spec/unit/transaction/resource_harness_spec.rb
+++ b/spec/unit/transaction/resource_harness_spec.rb
@@ -125,6 +125,29 @@ describe Puppet::Transaction::ResourceHarness do
end
end
+ describe "when auditing" do
+ it "should not call insync? on parameters that are merely audited" do
+ stub_provider = make_stub_provider
+ resource = stub_provider.new :name => 'name', :audit => ['foo']
+ resource.property(:foo).expects(:insync?).never
+ status = @harness.evaluate(resource)
+ status.events.each do |event|
+ event.status.should != 'failure'
+ end
+ end
+
+ it "should be able to audit a file's group" do # see bug #5710
+ test_file = tmpfile('foo')
+ File.open(test_file, 'w').close
+ resource = Puppet::Type.type(:file).new :path => test_file, :audit => ['group'], :backup => false
+ resource.expects(:err).never # make sure no exceptions get swallowed
+ status = @harness.evaluate(resource)
+ status.events.each do |event|
+ event.status.should != 'failure'
+ end
+ end
+ end
+
describe "when applying changes" do
[false, true].each do |noop_mode|; describe (noop_mode ? "in noop mode" : "in normal mode") do
[nil, '750'].each do |machine_state|; describe (machine_state ? "with a file initially present" : "with no file initially present") do