aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2013-05-27 19:19:37 +0200
committerYves Senn <yves.senn@gmail.com>2013-05-28 09:19:00 +0200
commit1c998a7f131a844ed58d94b70b3f5d9ef071a259 (patch)
treed33b09c13e93732510322cec98b0e496d52d581a /activerecord/test/cases/adapters
parent5a687e930ffd4785be7af4816f97000fc3e948b3 (diff)
downloadrails-1c998a7f131a844ed58d94b70b3f5d9ef071a259.tar.gz
rails-1c998a7f131a844ed58d94b70b3f5d9ef071a259.tar.bz2
rails-1c998a7f131a844ed58d94b70b3f5d9ef071a259.zip
test cleanup, replace `define_method` and `remove_method` with stubs.
Diffstat (limited to 'activerecord/test/cases/adapters')
-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