diff options
author | Luke Kanies <luke@madstop.com> | 2008-04-11 13:50:36 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-04-11 13:50:36 -0500 |
commit | a6a397b21ce9306307c7614b671de63d74d8141e (patch) | |
tree | c8f180d82ad72af990c50dd3fe2e0fe02c81a6d8 | |
parent | 04aba5253d774fae013919605363022781f16d55 (diff) | |
download | puppet-a6a397b21ce9306307c7614b671de63d74d8141e.tar.gz puppet-a6a397b21ce9306307c7614b671de63d74d8141e.tar.xz puppet-a6a397b21ce9306307c7614b671de63d74d8141e.zip |
The 'destroy' method in the indirection now returns
the results of destroying, so they can return true
or false.
-rw-r--r-- | lib/puppet/indirector/indirection.rb | 4 | ||||
-rwxr-xr-x | spec/unit/indirector/indirection.rb | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/puppet/indirector/indirection.rb b/lib/puppet/indirector/indirection.rb index 606234dd0..05464f8c9 100644 --- a/lib/puppet/indirector/indirection.rb +++ b/lib/puppet/indirector/indirection.rb @@ -225,14 +225,14 @@ class Puppet::Indirector::Indirection request = request(:destroy, key, *args) terminus = prepare(request) - terminus.destroy(request) + result = terminus.destroy(request) if cache? and cached = cache.find(request(:find, key, *args)) # Reuse the existing request, since it's equivalent. cache.destroy(request) end - nil + result end # Search for more than one instance. Should always return an array. diff --git a/spec/unit/indirector/indirection.rb b/spec/unit/indirector/indirection.rb index e8ab9633b..cefd0557e 100755 --- a/spec/unit/indirector/indirection.rb +++ b/spec/unit/indirector/indirection.rb @@ -356,9 +356,9 @@ describe Puppet::Indirector::Indirection do it_should_behave_like "Indirection Delegator" it_should_behave_like "Delegation Authorizer" - it "should return nil" do - @terminus.stubs(:destroy) - @indirection.destroy("/my/key").should be_nil + it "should return the result of removing the instance" do + @terminus.stubs(:destroy).returns "yayness" + @indirection.destroy("/my/key").should == "yayness" end describe "when caching is enabled" do |