summaryrefslogtreecommitdiffstats
path: root/spec/unit/util/cacher.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/util/cacher.rb')
-rwxr-xr-xspec/unit/util/cacher.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/unit/util/cacher.rb b/spec/unit/util/cacher.rb
index 3e8d31a24..5a867c6c1 100755
--- a/spec/unit/util/cacher.rb
+++ b/spec/unit/util/cacher.rb
@@ -79,6 +79,21 @@ describe Puppet::Util::Cacher do
@object.instance_cache.should_not equal(value)
end
+ it "should be able to trigger expiration on its expirer" do
+ @expirer.expects(:expire)
+ @object.expire
+ end
+
+ it "should do nothing when asked to expire when no expirer is available" do
+ cacher = CacheTest.new
+ class << cacher
+ def expirer
+ nil
+ end
+ end
+ lambda { cacher.expire }.should_not raise_error
+ end
+
it "should be able to cache false values" do
@object.expects(:init_instance_cache).returns false
@object.instance_cache.should be_false