summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/puppet/indirector/indirection.rb2
-rwxr-xr-xspec/unit/indirector/indirection.rb5
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/puppet/indirector/indirection.rb b/lib/puppet/indirector/indirection.rb
index c560bb5b7..2eac2395b 100644
--- a/lib/puppet/indirector/indirection.rb
+++ b/lib/puppet/indirector/indirection.rb
@@ -47,7 +47,7 @@ class Puppet::Indirector::Indirection
attr_reader :cache_class
# Define a terminus class to be used for caching.
def cache_class=(class_name)
- validate_terminus_class(class_name)
+ validate_terminus_class(class_name) if class_name
@cache_class = class_name
end
diff --git a/spec/unit/indirector/indirection.rb b/spec/unit/indirector/indirection.rb
index 71dc4d24f..51bd45473 100755
--- a/spec/unit/indirector/indirection.rb
+++ b/spec/unit/indirector/indirection.rb
@@ -690,8 +690,9 @@ describe Puppet::Indirector::Indirection do
proc { @indirection.cache_class = "" }.should raise_error(ArgumentError)
end
- it "should fail to set the cache class when the cache class name is nil" do
- proc { @indirection.cache_class = nil }.should raise_error(ArgumentError)
+ it "should allow resetting the cache_class to nil" do
+ @indirection.cache_class = nil
+ @indirection.cache_class.should be_nil
end
it "should fail to set the cache class when the specified cache class cannot be found" do