diff options
author | Matt Robinson <matt@puppetlabs.com> | 2011-01-06 11:24:18 -0800 |
---|---|---|
committer | Matt Robinson <matt@puppetlabs.com> | 2011-01-06 11:24:18 -0800 |
commit | df653045aee21ae53e0e94d47e0edbdaf308fbf5 (patch) | |
tree | c3d3e4875c949d5f63ac12ced517037a9826e1be /spec/unit/application | |
parent | 83ac3e789ddc8dbf40c93460032474870fb16c54 (diff) | |
download | puppet-df653045aee21ae53e0e94d47e0edbdaf308fbf5.tar.gz puppet-df653045aee21ae53e0e94d47e0edbdaf308fbf5.tar.xz puppet-df653045aee21ae53e0e94d47e0edbdaf308fbf5.zip |
maint: Inspect reports should have audited = true on events
Paired-with: Jesse Wolfe
Diffstat (limited to 'spec/unit/application')
-rw-r--r-- | spec/unit/application/inspect_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/unit/application/inspect_spec.rb b/spec/unit/application/inspect_spec.rb index b931708c3..b3224d577 100644 --- a/spec/unit/application/inspect_spec.rb +++ b/spec/unit/application/inspect_spec.rb @@ -72,6 +72,26 @@ describe Puppet::Application::Inspect do properties.has_key?("target").should == false end + it "should set audited to true for all events" do + catalog = Puppet::Resource::Catalog.new + file = Tempfile.new("foo") + resource = Puppet::Resource.new(:file, file.path, :parameters => {:audit => "all"}) + catalog.add_resource(resource) + Puppet::Resource::Catalog::Yaml.any_instance.stubs(:find).returns(catalog) + + events = nil + + Puppet::Transaction::Report::Rest.any_instance.expects(:save).with do |request| + events = request.instance.resource_statuses.values.first.events + end + + @inspect.run_command + + events.each do |event| + event.audited.should == true + end + end + it "should not report irrelevent attributes if the resource is absent" do catalog = Puppet::Resource::Catalog.new file = Tempfile.new("foo") |