diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2012-04-24 09:57:15 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2012-04-24 09:57:15 -0700 |
commit | dbef5a0a5bfba403c1de349f308f86c76064bbde (patch) | |
tree | 8b7332570115b5ba5601845e1901467276eaad86 | |
parent | 71bd5096beb541866dec7599865b5ea7a693482d (diff) | |
parent | 2aa7c6d065802cd230a812b8331ee293e4aae0e8 (diff) | |
download | rails-dbef5a0a5bfba403c1de349f308f86c76064bbde.tar.gz rails-dbef5a0a5bfba403c1de349f308f86c76064bbde.tar.bz2 rails-dbef5a0a5bfba403c1de349f308f86c76064bbde.zip |
Merge pull request #5963 from kennyj/fix_build_20120425
Fix build. It seems that the Mocha's behavior was changed.
-rw-r--r-- | activerecord/test/cases/autosave_association_test.rb | 8 | ||||
-rw-r--r-- | activerecord/test/cases/explain_test.rb | 4 |
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 d15487ab11..d555c1699e 100644 --- a/activerecord/test/cases/autosave_association_test.rb +++ b/activerecord/test/cases/autosave_association_test.rb @@ -627,7 +627,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 @@ -672,7 +674,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 |