diff options
author | Tarmo Tänav <tarmo@itech.ee> | 2008-05-07 02:08:23 +0300 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-05-07 13:01:46 +1200 |
commit | 8877ab5852d9a1133eb9a730ae47dde214bafe55 (patch) | |
tree | b712ec73b9a7f0c76304a6857f40bd7d4d2317e6 /activerecord/test/cases/adapter_test.rb | |
parent | e520fd5db7cb839b862c03647effee50f9223d98 (diff) | |
download | rails-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.rb | 19 |
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 |