shard-crystal-db/spec/std/db/driver_spec.cr
Brian J. Cardiff 1572062501 introduce database as driver wrapper.
expose list of types to support by the drivers implementors.
deal with nilable types with `#read?(T.class) : T?` methods.
change `#has_next` to `#move_next`
2016-02-25 22:25:54 -03:00

16 lines
431 B
Crystal

require "spec"
require "db"
require "./dummy_driver"
describe DB::Driver do
it "should get driver class by name" do
DB.driver_class("dummy").should eq(DummyDriver)
end
it "should instantiate driver with options" do
db = DB.open "dummy", {"host": "localhost", "port": "1027"}
db.driver_class.should eq(DummyDriver)
db.options["host"].should eq("localhost")
db.options["port"].should eq("1027")
end
end