Skip to content

Commit

Permalink
Fixed test_rename_nonexistent_column for PostgreSQL
Browse files Browse the repository at this point in the history
Also fixed ability to run migration_test.rb alone

[#616 state:resolved]
  • Loading branch information
tarmo authored and jeremy committed Jul 15, 2008
1 parent 275c3ab commit 8a548e4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion activerecord/test/cases/migration_test.rb
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8a548e4

Please sign in to comment.