diff options
| author | Markus Roberts <Markus@reality.com> | 2010-03-29 17:16:05 -0700 |
|---|---|---|
| committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
| commit | 49be54e5d4c5c19ec1f7e5e454666bb59ebfe88f (patch) | |
| tree | a3efe74b49b771200e9a45b59961266083107434 /spec/unit/indirector/indirection.rb | |
| parent | e69b7db9124b9b1cd65ab89a2f5c6968928f256d (diff) | |
| download | puppet-49be54e5d4c5c19ec1f7e5e454666bb59ebfe88f.tar.gz puppet-49be54e5d4c5c19ec1f7e5e454666bb59ebfe88f.tar.xz puppet-49be54e5d4c5c19ec1f7e5e454666bb59ebfe88f.zip | |
Revert the guts of #2890
This patch reverts the semantically significant parts of #2890 due to the
issues discussed on #3360 (security concerns when used with autosign,
inconsistency between REST & XMLRPC semantics) but leaves the semantically
neutral changes (code cleanup, added tests) in place.
This patch is intended for 0.25.x, but may also be applied as a step in the
resolution of #3450 (refactored #2890, add "remove_certs" flag) in Rolwf.
Diffstat (limited to 'spec/unit/indirector/indirection.rb')
| -rwxr-xr-x | spec/unit/indirector/indirection.rb | 45 |
1 files changed, 17 insertions, 28 deletions
diff --git a/spec/unit/indirector/indirection.rb b/spec/unit/indirector/indirection.rb index 0663fe55e..0f6fd13d5 100755 --- a/spec/unit/indirector/indirection.rb +++ b/spec/unit/indirector/indirection.rb @@ -545,44 +545,33 @@ describe Puppet::Indirector::Indirection do @indirection.expire("/my/key") end - describe "and the terminus supports removal of cache items with destroy" do - it "should destroy the cached instance" do - @cache.expects(:find).returns @cached - @cache.expects(:destroy).with { |r| r.method == :destroy and r.key == "/my/key" } - @cache.expects(:save).never - @indirection.expire("/my/key") - end - end - - describe "and the terminus does not support removal of cache items with destroy" do - it "should set the cached instance's expiration to a time in the past" do - @cache.expects(:find).returns @cached - @cache.stubs(:save) + it "should set the cached instance's expiration to a time in the past" do + @cache.expects(:find).returns @cached + @cache.stubs(:save) - @cached.expects(:expiration=).with { |t| t < Time.now } + @cached.expects(:expiration=).with { |t| t < Time.now } - @indirection.expire("/my/key") - end + @indirection.expire("/my/key") + end - it "should save the now expired instance back into the cache" do - @cache.expects(:find).returns @cached + it "should save the now expired instance back into the cache" do + @cache.expects(:find).returns @cached - @cached.expects(:expiration=).with { |t| t < Time.now } + @cached.expects(:expiration=).with { |t| t < Time.now } - @cache.expects(:save) + @cache.expects(:save) - @indirection.expire("/my/key") - end + @indirection.expire("/my/key") + end - it "should use a request to save the expired resource to the cache" do - @cache.expects(:find).returns @cached + it "should use a request to save the expired resource to the cache" do + @cache.expects(:find).returns @cached - @cached.expects(:expiration=).with { |t| t < Time.now } + @cached.expects(:expiration=).with { |t| t < Time.now } - @cache.expects(:save).with { |r| r.is_a?(Puppet::Indirector::Request) and r.instance == @cached and r.method == :save }.returns(@cached) + @cache.expects(:save).with { |r| r.is_a?(Puppet::Indirector::Request) and r.instance == @cached and r.method == :save }.returns(@cached) - @indirection.expire("/my/key") - end + @indirection.expire("/my/key") end end end |
