From 88c802f355de942bb55b2d1b894e469c1680098c Mon Sep 17 00:00:00 2001 From: Josh Bodah Date: Wed, 14 Aug 2019 08:16:19 -0400 Subject: [PATCH] fix Ruby method redef warning --- lib/spy/strategy/wrap.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/spy/strategy/wrap.rb b/lib/spy/strategy/wrap.rb index d2aac36..531f733 100644 --- a/lib/spy/strategy/wrap.rb +++ b/lib/spy/strategy/wrap.rb @@ -8,11 +8,11 @@ def initialize(spy) end def apply - ReplaceMethod.call(@spy.original.owner, @spy, mode: :stub) + ReplaceMethod.call(@spy.original.owner, @spy, mode: :stub, remove_existing: true) end def undo - ReplaceMethod.call(@spy.original.owner, @spy, mode: :restore) + ReplaceMethod.call(@spy.original.owner, @spy, mode: :restore, remove_existing: true) end end end