Sha256: 1fd9aac4380448c414170bd09578ffd375d6935eef62e4eb58d6318d5bc11842
Contents?: true
Size: 1.26 KB
Versions: 15
Compression:
Stored size: 1.26 KB
Contents
describe NanoStore do class Spaceship < NanoStore::Model attribute :name end it "create :memory store" do store = NanoStore.store store.filePath.should == ":memory:" store = NanoStore.store :memory store.filePath.should == ":memory:" end it "create :persistent store" do path = documents_path + "/nano.db" store = NanoStore.store :persistent, path store.filePath.should == path path = documents_path + "/nano.db" store = NanoStore.store :file, path store.filePath.should == path end it "create :temp store" do store = NanoStore.store :temp store.filePath.should == "" store = NanoStore.store :temporary store.filePath.should == "" end it "should use shared_store if a model has no store defined" do NanoStore.shared_store = NanoStore.store Spaceship.store.should.not.be.nil NanoStore.shared_store.should.not.be.nil Spaceship.store.should == NanoStore.shared_store Spaceship.store = NanoStore.store :temp Spaceship.store.should.not == NanoStore.shared_store end it "should enable and disable debug mode" do NanoStore.debug = true NanoStore.shared_store = NanoStore.store NanoStore.debug = false NanoStore.shared_store.should.not.be.nil end end
Version data entries
15 entries across 15 versions & 1 rubygems