diff options
author | Luke Kanies <luke@madstop.com> | 2008-11-20 13:55:14 -0600 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2008-11-21 09:11:03 +1100 |
commit | eb0d32a1548314713dc3a1360a4e9d44621afcfc (patch) | |
tree | d3522f9551fe6cbfa5665ff1fdce872d866afa39 /spec/unit | |
parent | e9f858a1f9108c523efb3856e3ce46e3f9615646 (diff) | |
download | puppet-eb0d32a1548314713dc3a1360a4e9d44621afcfc.tar.gz puppet-eb0d32a1548314713dc3a1360a4e9d44621afcfc.tar.xz puppet-eb0d32a1548314713dc3a1360a4e9d44621afcfc.zip |
Fixing #1764 - a property's 'sync' method is never considered a no-op.
*This is a behaviour change.*
If the property does not return an event name, then one is generated
based on the property name.
Previously, the 'sync' method could return nil and it would be considered
a noop, but if you need a noop, then you need to modify your 'insync?' method
to return 'true' in the noop cases.
Also modifying all of the builtin types that didn't handle this explicitly or
returned nil in 'sync'. There should be no behaviour change in any of them.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit')
-rwxr-xr-x | spec/unit/transaction/change.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/spec/unit/transaction/change.rb b/spec/unit/transaction/change.rb index eaa6fb4ab..1f69311cd 100755 --- a/spec/unit/transaction/change.rb +++ b/spec/unit/transaction/change.rb @@ -108,6 +108,7 @@ describe Puppet::Transaction::Change do @change.stubs(:noop?).returns false @property.stub_everything @property.stubs(:resource).returns "myresource" + @property.stubs(:name).returns :myprop end it "should sync the property" do @@ -116,16 +117,20 @@ describe Puppet::Transaction::Change do @change.forward end - it "should return nil if syncing the property returns nil" do + it "should return the default event if syncing the property returns nil" do @property.stubs(:sync).returns nil - @change.forward.should be_nil + @change.expects(:event).with(:myprop_changed).returns :myevent + + @change.forward.should == [:myevent] end - it "should return nil if syncing the property returns an empty array" do + it "should return the default event if syncing the property returns an empty array" do @property.stubs(:sync).returns [] - @change.forward.should be_nil + @change.expects(:event).with(:myprop_changed).returns :myevent + + @change.forward.should == [:myevent] end it "should log the change" do |