Skip to content
Browse files

Fix build. It seems that the Mocha's behavior were changed.

  • Loading branch information...
1 parent db6787a commit d95f3d3f73174e5fd946457ab376efbec744c9d5 @kennyj kennyj committed with sikachu
Showing with 9 additions and 3 deletions.
  1. +6 −2 activerecord/test/cases/autosave_association_test.rb
  2. +3 −1 activerecord/test/cases/explain_test.rb
View
8 activerecord/test/cases/autosave_association_test.rb
@@ -626,7 +626,9 @@ def test_should_skip_validation_on_a_child_association_if_marked_for_destruction
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 @@ def test_should_skip_validation_on_a_parent_association_if_marked_for_destructio
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
View
4 activerecord/test/cases/explain_test.rb
@@ -28,7 +28,9 @@ def test_logging_query_plan_without_logger
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

0 comments on commit d95f3d3

Please sign in to comment.
Something went wrong with that request. Please try again.