Permalink
Browse files

adding more behavioral tests for the sqlite adapter

  • Loading branch information...
tenderlove committed Jul 10, 2010
1 parent 2f04c87 commit 1e1af8f612ce5649f529fd2dcb573c9b42b455ad
Showing with 20 additions and 0 deletions.
  1. +20 −0 activerecord/test/cases/adapters/sqlite/sqlite_adapter_test.rb
@@ -83,6 +83,26 @@ def test_transaction
assert_equal 0, @ctx.select_rows(count_sql).first.first
end
+ def test_tables
+ assert_equal %w{ items }, @ctx.tables
+
+ @ctx.execute <<-eosql
+ CREATE TABLE people (
+ id integer PRIMARY KEY AUTOINCREMENT,
+ number integer
+ )
+ eosql
+ assert_equal %w{ items people }.sort, @ctx.tables.sort
+ end
+
+ def test_tables_logs_name
+ name = "hello"
+ assert_logged [[name]] do
+ @ctx.tables(name)
+ assert_not_nil @ctx.logged.first.shift
+ end
+ end
+
def assert_logged logs
@ctx.extend(Module.new {
attr_reader :logged

0 comments on commit 1e1af8f

Please sign in to comment.