aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-05-28 05:39:28 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-05-28 05:39:28 -0700
commitbf4f8211e1bc76fe4976d37998c81994b6dc3864 (patch)
treed33b09c13e93732510322cec98b0e496d52d581a /activerecord/test/cases
parent5a687e930ffd4785be7af4816f97000fc3e948b3 (diff)
parent1c998a7f131a844ed58d94b70b3f5d9ef071a259 (diff)
downloadrails-bf4f8211e1bc76fe4976d37998c81994b6dc3864.tar.gz
rails-bf4f8211e1bc76fe4976d37998c81994b6dc3864.tar.bz2
rails-bf4f8211e1bc76fe4976d37998c81994b6dc3864.zip
Merge pull request #10775 from senny/postgres_adapter_test_cleanup
test cleanup, replace `define_method` and `remove_method` with stubs.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/adapters/postgresql/active_schema_test.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/active_schema_test.rb b/activerecord/test/cases/adapters/postgresql/active_schema_test.rb
index 16329689c0..22dd48e113 100644
--- a/activerecord/test/cases/adapters/postgresql/active_schema_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/active_schema_test.rb
@@ -25,9 +25,7 @@ class PostgresqlActiveSchemaTest < ActiveRecord::TestCase
def test_add_index
# add_index calls index_name_exists? which can't work since execute is stubbed
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.send(:define_method, :index_name_exists?) do |*|
- false
- end
+ ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.stubs(:index_name_exists?).returns(false)
expected = %(CREATE UNIQUE INDEX "index_people_on_last_name" ON "people" ("last_name") WHERE state = 'active')
assert_equal expected, add_index(:people, :last_name, :unique => true, :where => "state = 'active'")
@@ -51,8 +49,6 @@ class PostgresqlActiveSchemaTest < ActiveRecord::TestCase
expected = %(CREATE UNIQUE INDEX "index_people_on_last_name" ON "people" USING gist ("last_name") WHERE state = 'active')
assert_equal expected, add_index(:people, :last_name, :unique => true, :where => "state = 'active'", :using => :gist)
-
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.send(:remove_method, :index_name_exists?)
end
private