Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: rspec/rspec-mocks
...
head fork: rspec/rspec-mocks
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 10 additions and 9 deletions.
  1. +10 −9 lib/rspec/mocks/any_instance/recorder.rb
View
19 lib/rspec/mocks/any_instance/recorder.rb
@@ -170,15 +170,16 @@ def already_observing?(method_name)
end
def observe!(method_name)
- stop_observing!(method_name) if already_observing?(method_name)
- @observed_methods << method_name
- backup_method!(method_name)
- @klass.class_eval(<<-EOM, __FILE__, __LINE__)
- def #{method_name}(*args, &blk)
- self.class.__recorder.playback!(self, :#{method_name})
- self.__send__(:#{method_name}, *args, &blk)
- end
- EOM
+ unless already_observing?(method_name)
+ @observed_methods << method_name
+ backup_method!(method_name)
+ @klass.class_eval(<<-EOM, __FILE__, __LINE__)
+ def #{method_name}(*args, &blk)
+ self.class.__recorder.playback!(self, :#{method_name})
+ self.__send__(:#{method_name}, *args, &blk)
+ end
+ EOM
+ end
end
def mark_invoked!(method_name)

No commit comments for this range

Something went wrong with that request. Please try again.