Permalink
Browse files

Fixed test_rename_nonexistent_column for PostgreSQL

Also fixed ability to run migration_test.rb alone

[#616 state:resolved]
  • Loading branch information...
1 parent c760dbf commit 8f72bc92e20b1242272714f253e23b256761ec1a @tarmo tarmo committed with jeremy Jul 14, 2008
Showing with 7 additions and 1 deletion.
  1. +7 −1 activerecord/test/cases/migration_test.rb
@@ -3,6 +3,7 @@
require 'models/person'
require 'models/topic'
+require 'models/developer'
require MIGRATIONS_ROOT + "/valid/1_people_have_last_names"
require MIGRATIONS_ROOT + "/valid/2_we_need_reminders"
@@ -511,7 +512,12 @@ def test_rename_nonexistent_column
ActiveRecord::Base.connection.create_table(:hats) do |table|
table.column :hat_name, :string, :default => nil
end
- assert_raises(ActiveRecord::ActiveRecordError) do
+ exception = if current_adapter?(:PostgreSQLAdapter)
+ ActiveRecord::StatementInvalid
+ else
+ ActiveRecord::ActiveRecordError
+ end
+ assert_raises(exception) do
Person.connection.rename_column "hats", "nonexistent", "should_fail"
end
ensure

0 comments on commit 8f72bc9

Please sign in to comment.