diff options
| author | Luke Kanies <luke@madstop.com> | 2009-05-21 10:00:45 -0500 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2009-05-22 09:11:49 +1000 |
| commit | e13befa963323dfcd4b6d8e14b0f6980946b7e1b (patch) | |
| tree | c537af87be594f311d1281b0d627391e4a777d52 /spec/unit/util/cacher.rb | |
| parent | a406d585ce861757d6c14e0696a3847b46e4319d (diff) | |
| download | puppet-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-x | spec/unit/util/cacher.rb | 9 |
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 |
