Skip to content
This repository
Browse code

adding more behavioral tests for the sqlite adapter

  • Loading branch information...
commit 1e1af8f612ce5649f529fd2dcb573c9b42b455ad 1 parent 2f04c87
Aaron Patterson authored July 09, 2010
20  activerecord/test/cases/adapters/sqlite/sqlite_adapter_test.rb
@@ -83,6 +83,26 @@ def test_transaction
83 83
         assert_equal 0, @ctx.select_rows(count_sql).first.first
84 84
       end
85 85
 
  86
+      def test_tables
  87
+        assert_equal %w{ items }, @ctx.tables
  88
+
  89
+        @ctx.execute <<-eosql
  90
+          CREATE TABLE people (
  91
+            id integer PRIMARY KEY AUTOINCREMENT,
  92
+            number integer
  93
+          )
  94
+        eosql
  95
+        assert_equal %w{ items people }.sort, @ctx.tables.sort
  96
+      end
  97
+
  98
+      def test_tables_logs_name
  99
+        name = "hello"
  100
+        assert_logged [[name]] do
  101
+          @ctx.tables(name)
  102
+          assert_not_nil @ctx.logged.first.shift
  103
+        end
  104
+      end
  105
+
86 106
       def assert_logged logs
87 107
         @ctx.extend(Module.new {
88 108
           attr_reader :logged

0 notes on commit 1e1af8f

Please sign in to comment.
Something went wrong with that request. Please try again.