diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-18 03:54:04 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-18 03:54:04 +0000 |
commit | 0555fc905c09d4339bfb641428a4ddfcb5f4c0c6 (patch) | |
tree | 5dcf5a5b409765fc32bbb5d082d3e1e962dd8934 /activerecord/test | |
parent | df97ed5e4c986be875248ec1b27d7acfc200ae9c (diff) | |
download | rails-0555fc905c09d4339bfb641428a4ddfcb5f4c0c6.tar.gz rails-0555fc905c09d4339bfb641428a4ddfcb5f4c0c6.tar.bz2 rails-0555fc905c09d4339bfb641428a4ddfcb5f4c0c6.zip |
Added connection#current_database that'll return of the current database (only works in MySQL, SQL Server, and Oracle so far -- please help implement for the rest of the adapters) (closes #3663) [Tom ward]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3911 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/adapter_test.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/activerecord/test/adapter_test.rb b/activerecord/test/adapter_test.rb index 9edc7cc640..af76ebfc9a 100644 --- a/activerecord/test/adapter_test.rb +++ b/activerecord/test/adapter_test.rb @@ -18,8 +18,9 @@ class AdapterTest < Test::Unit::TestCase end def test_indexes + idx_name = "accounts_idx" + if @connection.respond_to?(:indexes) - idx_name = "accounts_idx" indexes = @connection.indexes("accounts") assert indexes.empty? @@ -34,7 +35,15 @@ class AdapterTest < Test::Unit::TestCase end ensure - @connection.remove_index :accounts, :firm_id rescue nil + @connection.remove_index(:accounts, :name => idx_name) rescue nil + end + + def test_current_database + if @connection.respond_to?(:current_database) + assert_equal "activerecord_unittest", @connection.current_database + else + warn "#{@connection.class} does not respond to #current_database" + end end # test resetting sequences in odd tables in postgreSQL |