aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2012-04-24 13:29:39 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2012-04-24 13:29:39 -0700
commit9212083cd4ddb925882cde964b5e04eba4cc29f5 (patch)
tree96faf4e2c1fde1c42b7e56c27f802170cee1fb3d /activerecord
parentdb6787af681a74499339bc4b9f83d817c6353410 (diff)
parentd95f3d3f73174e5fd946457ab376efbec744c9d5 (diff)
downloadrails-9212083cd4ddb925882cde964b5e04eba4cc29f5.tar.gz
rails-9212083cd4ddb925882cde964b5e04eba4cc29f5.tar.bz2
rails-9212083cd4ddb925882cde964b5e04eba4cc29f5.zip
Merge pull request #5968 from sikachu/3-2-stable-backport
Backport workarounds for Mocha behavior changes.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/autosave_association_test.rb8
-rw-r--r--activerecord/test/cases/explain_test.rb4
2 files changed, 9 insertions, 3 deletions
diff --git a/activerecord/test/cases/autosave_association_test.rb b/activerecord/test/cases/autosave_association_test.rb
index 4c3f2bda57..315a9b001b 100644
--- a/activerecord/test/cases/autosave_association_test.rb
+++ b/activerecord/test/cases/autosave_association_test.rb
@@ -626,7 +626,9 @@ class TestDestroyAsPartOfAutosaveAssociation < ActiveRecord::TestCase
def test_a_child_marked_for_destruction_should_not_be_destroyed_twice
@pirate.ship.mark_for_destruction
assert @pirate.save
- @pirate.ship.expects(:destroy).never
+ class << @pirate.ship
+ def destroy; raise "Should not be called" end
+ end
assert @pirate.save
end
@@ -671,7 +673,9 @@ class TestDestroyAsPartOfAutosaveAssociation < ActiveRecord::TestCase
def test_a_parent_marked_for_destruction_should_not_be_destroyed_twice
@ship.pirate.mark_for_destruction
assert @ship.save
- @ship.pirate.expects(:destroy).never
+ class << @ship.pirate
+ def destroy; raise "Should not be called" end
+ end
assert @ship.save
end
diff --git a/activerecord/test/cases/explain_test.rb b/activerecord/test/cases/explain_test.rb
index 83c9b6e107..cb7781f8e7 100644
--- a/activerecord/test/cases/explain_test.rb
+++ b/activerecord/test/cases/explain_test.rb
@@ -28,7 +28,9 @@ if ActiveRecord::Base.connection.supports_explain?
original = base.logger
base.logger = nil
- base.logger.expects(:warn).never
+ class << base.logger
+ def warn; raise "Should not be called" end
+ end
with_threshold(0) do
car = Car.where(:name => 'honda').first