test/test_tacky.rb in tacky-0.2.0 vs test/test_tacky.rb in tacky-0.3.0
- old
+ new
@@ -37,6 +37,20 @@
end
bar = Tacky.new(foo)
first = bar.value
assert(bar.value == first)
end
+
+ def test_deep_caching
+ foo = Object.new
+ def foo.child
+ bar = Object.new
+ def bar.value
+ rand(100)
+ end
+ bar
+ end
+ bar = Tacky.new(foo, deep: true)
+ first = bar.child.value
+ assert(bar.child.value == first)
+ end
end