mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
1572062501
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`
16 lines
431 B
Crystal
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
|