Sha256: 40f10c9a9426094a3e19d83f8ac918c80bf430d630525ba3e5dffb3a974fc673
Contents?: true
Size: 967 Bytes
Versions: 13
Compression:
Stored size: 967 Bytes
Contents
require File.join(File.dirname(File.expand_path(__FILE__)), "spec_helper") describe "freeze_datasets extension" do before do @db = Sequel.mock.extension(:freeze_datasets) end it "should freeze datasets by default" do @db.dataset.frozen?.must_equal true @db.fetch('SQL').frozen?.must_equal true @db.from(:table).frozen?.must_equal true @db[:table].frozen?.must_equal true end it "should have dataset#dup return frozen dataset" do @db.dataset.dup.frozen?.must_equal true end it "should cache Database#from calls with single symbol tables" do @db.from(:foo).must_be_same_as @db.from(:foo) @db.from(Sequel[:foo]).wont_be_same_as @db.from(Sequel[:foo]) end it "should clear Database#from cache when modifying the schema" do ds = @db.from(:foo) ds.columns(:foo, :bar) @db[:foo].columns.must_equal [:foo, :bar] @db.create_table!(:foo){Integer :x} @db[:foo].columns.wont_equal [:foo, :bar] end end
Version data entries
13 entries across 11 versions & 2 rubygems