summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-03-31 17:34:16 -0700
committerJames Turnbull <james@lovedthanlost.net>2010-05-02 17:38:19 +1000
commit5abe571e167744ac198960c8e35c699375ec5cf7 (patch)
tree695d8b75d7940fd5f81b56b8cb1fc8db6d9d248c /spec/unit
parentebd924c22c1049cde5f110c6ec89de4d9358b649 (diff)
Bug #3451: Don't leak the terminus class setting from Puppet::Resource::Catalog's spec
This issue causes other specs to fail, because they depend on the default terminus being unchanged.
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/resource/catalog.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/unit/resource/catalog.rb b/spec/unit/resource/catalog.rb
index ab6aa68be..73c327367 100755
--- a/spec/unit/resource/catalog.rb
+++ b/spec/unit/resource/catalog.rb
@@ -832,6 +832,8 @@ describe Puppet::Resource::Catalog, "when compiling" do
describe "when indirecting" do
before do
+ @real_indirection = Puppet::Resource::Catalog.indirection
+
@indirection = stub 'indirection', :name => :catalog
Puppet::Util::Cacher.expire
@@ -844,6 +846,11 @@ describe Puppet::Resource::Catalog, "when compiling" do
end
it "should use the value of the 'catalog_terminus' setting to determine its terminus class" do
+ # Puppet only checks the terminus setting the first time you ask
+ # so this returns the object to the clean state
+ # at the expense of making this test less pure
+ Puppet::Resource::Catalog.indirection.reset_terminus_class
+
Puppet.settings[:catalog_terminus] = "rest"
Puppet::Resource::Catalog.indirection.terminus_class.should == :rest
end
@@ -855,6 +862,7 @@ describe Puppet::Resource::Catalog, "when compiling" do
after do
Puppet::Util::Cacher.expire
+ @real_indirection.reset_terminus_class
end
end