summaryrefslogtreecommitdiffstats
path: root/spec/unit/util/cacher.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-05-21 10:00:45 -0500
committerJames Turnbull <james@lovedthanlost.net>2009-05-22 09:11:49 +1000
commite13befa963323dfcd4b6d8e14b0f6980946b7e1b (patch)
treec537af87be594f311d1281b0d627391e4a777d52 /spec/unit/util/cacher.rb
parenta406d585ce861757d6c14e0696a3847b46e4319d (diff)
downloadpuppet-e13befa963323dfcd4b6d8e14b0f6980946b7e1b.tar.gz
puppet-e13befa963323dfcd4b6d8e14b0f6980946b7e1b.tar.xz
puppet-e13befa963323dfcd4b6d8e14b0f6980946b7e1b.zip
Fixing #2288 - fixing the tests broken by my attr_ttl code
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit/util/cacher.rb')
-rwxr-xr-xspec/unit/util/cacher.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/unit/util/cacher.rb b/spec/unit/util/cacher.rb
index 696ef6b19..d0f5d5e92 100755
--- a/spec/unit/util/cacher.rb
+++ b/spec/unit/util/cacher.rb
@@ -149,6 +149,15 @@ describe Puppet::Util::Cacher do
lambda { klass.cached_attr(:myattr, :ttl => "yep") { Time.now } }.should raise_error(ArgumentError)
end
+ it "should not check for a ttl expiration if the class does not support that method" do
+ klass = Class.new do
+ extend Puppet::Util::Cacher
+ end
+
+ klass.metaclass.cached_attr(:myattr) { "eh" }
+ klass.myattr
+ end
+
it "should automatically expire cached attributes whose ttl has expired, even if no expirer is present" do
klass = Class.new do
def self.to_s