diff options
| author | Nick Lewis <nick@puppetlabs.com> | 2010-12-29 16:00:23 -0800 |
|---|---|---|
| committer | Paul Berry <paul@puppetlabs.com> | 2010-12-30 11:55:15 -0800 |
| commit | bd4a8a13a85e6d64c987765cb83b1ebd4a63a341 (patch) | |
| tree | 6550c457968e6769395fbb7d551caef5e90704fa /spec/unit/transaction | |
| parent | 716ee1cd76a2b30c10e715bca3e22896d9c4e36f (diff) | |
| download | puppet-bd4a8a13a85e6d64c987765cb83b1ebd4a63a341.tar.gz puppet-bd4a8a13a85e6d64c987765cb83b1ebd4a63a341.tar.xz puppet-bd4a8a13a85e6d64c987765cb83b1ebd4a63a341.zip | |
(#5715) Make certain report attributes always present.
The attributes Puppet::Resource::Status#changed,
Puppet::Resource::Status#out_of_sync, and
Puppet::Transaction::Event#audited used to only appear in reports when
their state was true. Now they appear always.
Diffstat (limited to 'spec/unit/transaction')
| -rwxr-xr-x | spec/unit/transaction/event_spec.rb | 8 | ||||
| -rwxr-xr-x | spec/unit/transaction/resource_harness_spec.rb | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/spec/unit/transaction/event_spec.rb b/spec/unit/transaction/event_spec.rb index 4a3e6bad5..2776be8d7 100755 --- a/spec/unit/transaction/event_spec.rb +++ b/spec/unit/transaction/event_spec.rb @@ -5,7 +5,7 @@ require File.dirname(__FILE__) + '/../../spec_helper' require 'puppet/transaction/event' describe Puppet::Transaction::Event do - [:previous_value, :desired_value, :property, :resource, :name, :message, :file, :line, :tags].each do |attr| + [:previous_value, :desired_value, :property, :resource, :name, :message, :file, :line, :tags, :audited].each do |attr| it "should support #{attr}" do event = Puppet::Transaction::Event.new event.send(attr.to_s + "=", "foo") @@ -46,6 +46,12 @@ describe Puppet::Transaction::Event do Puppet::Transaction::Event.new.time.should be_instance_of(Time) end + describe "audit property" do + it "should default to false" do + Puppet::Transaction::Event.new.audited.should == false + end + end + describe "when sending logs" do before do Puppet::Util::Log.stubs(:new) diff --git a/spec/unit/transaction/resource_harness_spec.rb b/spec/unit/transaction/resource_harness_spec.rb index 387deca61..771c7b4b0 100755 --- a/spec/unit/transaction/resource_harness_spec.rb +++ b/spec/unit/transaction/resource_harness_spec.rb @@ -208,11 +208,11 @@ describe Puppet::Transaction::ResourceHarness do status.out_of_sync_count.should == expected_out_of_sync_count # Check legacy summary fields - status.changed.should == (expected_change_count == 0 ? nil : true) - status.out_of_sync.should == (expected_out_of_sync_count == 0 ? nil : true) + status.changed.should == (expected_change_count != 0) + status.out_of_sync.should == (expected_out_of_sync_count != 0) # Check the :synced field on state.yml - synced_should_be_set = !noop_mode && status.changed != nil + synced_should_be_set = !noop_mode && status.changed (@harness.cached(resource, :synced) != nil).should == synced_should_be_set end; end end |
