aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapter_test.rb
diff options
context:
space:
mode:
authorTarmo Tänav <tarmo@itech.ee>2008-05-07 02:08:23 +0300
committerMichael Koziarski <michael@koziarski.com>2008-05-07 13:01:46 +1200
commit8877ab5852d9a1133eb9a730ae47dde214bafe55 (patch)
treeb712ec73b9a7f0c76304a6857f40bd7d4d2317e6 /activerecord/test/cases/adapter_test.rb
parente520fd5db7cb839b862c03647effee50f9223d98 (diff)
downloadrails-8877ab5852d9a1133eb9a730ae47dde214bafe55.tar.gz
rails-8877ab5852d9a1133eb9a730ae47dde214bafe55.tar.bz2
rails-8877ab5852d9a1133eb9a730ae47dde214bafe55.zip
Added AbstractAdapter#table_exists? and made AbstractAdapter#table implementation non-optional
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Diffstat (limited to 'activerecord/test/cases/adapter_test.rb')
-rw-r--r--activerecord/test/cases/adapter_test.rb19
1 files changed, 10 insertions, 9 deletions
diff --git a/activerecord/test/cases/adapter_test.rb b/activerecord/test/cases/adapter_test.rb
index 8a74b6d6f5..91504af901 100644
--- a/activerecord/test/cases/adapter_test.rb
+++ b/activerecord/test/cases/adapter_test.rb
@@ -6,15 +6,16 @@ class AdapterTest < ActiveRecord::TestCase
end
def test_tables
- if @connection.respond_to?(:tables)
- tables = @connection.tables
- assert tables.include?("accounts")
- assert tables.include?("authors")
- assert tables.include?("tasks")
- assert tables.include?("topics")
- else
- warn "#{@connection.class} does not respond to #tables"
- end
+ tables = @connection.tables
+ assert tables.include?("accounts")
+ assert tables.include?("authors")
+ assert tables.include?("tasks")
+ assert tables.include?("topics")
+ end
+
+ def test_table_exists?
+ assert @connection.table_exists?("accounts")
+ assert !@connection.table_exists?("nonexistingtable")
end
def test_indexes