Documentation and some refactors

This commit is contained in:
Ary Borenszweig 2015-03-12 21:08:01 -03:00
parent d96255d766
commit d62185867b
10 changed files with 215 additions and 45 deletions

View file

@ -61,6 +61,18 @@ describe Database do
end
end
it "gets column types" do
Database.new(":memory:") do |db|
db.execute "create table person (name string, age integer)"
db.execute %(insert into person values ("foo", 10))
stmt = db.prepare("select * from person")
stmt.execute
stmt.step
stmt.types.should eq([Type::TEXT, Type::INTEGER])
stmt.close
end
end
it "gets column by name" do
Database.new(":memory:") do |db|
db.execute "create table person (name string, age integer)"