spec/extensions/static_cache_spec.rb in sequel-5.11.0 vs spec/extensions/static_cache_spec.rb in sequel-5.12.0
- old
+ new
@@ -262,9 +262,23 @@
@c.all.must_equal [@c.load(:id=>3)]
@c.as_hash.must_equal(3=>@c.load(:id=>3))
@c.as_hash[3].must_equal @c.all.first
@db.sqls.must_equal ['SELECT * FROM t2']
end
+
+ it "should have load_cache" do
+ a = @c.all.sort_by{|o| o.id}
+ a.first.must_equal @c1
+ a.last.must_equal @c2
+ @db.sqls.must_equal []
+
+ @c.load_cache
+
+ a = @c.all.sort_by{|o| o.id}
+ a.first.must_equal @c1
+ a.last.must_equal @c2
+ @db.sqls.must_equal ['SELECT * FROM t']
+ end
end
describe "without options" do
before do
@c.plugin :static_cache