Skip to content
Browse files

Update failing tests overriding destroy method instead of using mocha…

… expectation

Mocha by default does not allow adding expectation to frozen objects,
just applying a workaround to ensure the method is never called, making
the tests pass without enabling this again in mocha.
  • Loading branch information...
1 parent bb80a87 commit 597a70014e93d004f53810efee61cc954985adc6 @carlosantoniodasilva carlosantoniodasilva committed
Showing with 5 additions and 1 deletion.
  1. +5 −1 activerecord/test/cases/autosave_association_test.rb
View
6 activerecord/test/cases/autosave_association_test.rb
@@ -709,7 +709,11 @@ def save(*args)
children.each { |child| child.mark_for_destruction }
assert @pirate.save
- children.each { |child| child.expects(:destroy).never }
+ children.each { |child|
+ class << child
+ def destroy; raise "Should not be called" end
+ end
+ }
assert @pirate.save
end

0 comments on commit 597a700

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