diff options
Diffstat (limited to 'spec')
| -rwxr-xr-x | spec/unit/resource/status_spec.rb | 8 | ||||
| -rwxr-xr-x | spec/unit/transaction/event_spec.rb | 8 | ||||
| -rwxr-xr-x | spec/unit/transaction/resource_harness_spec.rb | 6 |
3 files changed, 14 insertions, 8 deletions
diff --git a/spec/unit/resource/status_spec.rb b/spec/unit/resource/status_spec.rb index 22d5fb4f9..3d9a84152 100755 --- a/spec/unit/resource/status_spec.rb +++ b/spec/unit/resource/status_spec.rb @@ -112,20 +112,20 @@ describe Puppet::Resource::Status do it "should not start with any changes" do @status.change_count.should == 0 - @status.changed.should be_false - @status.out_of_sync.should be_false + @status.changed.should == false + @status.out_of_sync.should == false end it "should not treat failure, audit, or noop events as changed" do ['failure', 'audit', 'noop'].each do |s| @status << Puppet::Transaction::Event.new(:status => s) end @status.change_count.should == 0 - @status.changed.should be_false + @status.changed.should == false end it "should not treat audit events as out of sync" do @status << Puppet::Transaction::Event.new(:status => 'audit') @status.out_of_sync_count.should == 0 - @status.out_of_sync.should be_false + @status.out_of_sync.should == false end ['failure', 'noop', 'success'].each do |event_status| 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 |
