Sha256: 291344b269ba181dbdea1b68d9047faeeecf6100c528f31ce3203b744ccc4968
Contents?: true
Size: 739 Bytes
Versions: 21
Compression:
Stored size: 739 Bytes
Contents
require File.join(File.dirname(File.expand_path(__FILE__)), "spec_helper") describe "pg_loose_count extension" do before do @db = Sequel.mock(:host=>'postgres', :fetch=>{:v=>1}).extension(:pg_loose_count) end it "should add loose_count method getting fast count for entire table using table statistics" do @db.loose_count(:a).must_equal 1 @db.sqls.must_equal ["SELECT CAST(reltuples AS integer) AS v FROM pg_class WHERE (oid = CAST(CAST('a' AS regclass) AS oid)) LIMIT 1"] end it "should support schema qualified tables" do @db.loose_count(:a__b).must_equal 1 @db.sqls.must_equal ["SELECT CAST(reltuples AS integer) AS v FROM pg_class WHERE (oid = CAST(CAST('a.b' AS regclass) AS oid)) LIMIT 1"] end end
Version data entries
21 entries across 21 versions & 2 rubygems