Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

whitespace and unnecessary refs to self

  • Loading branch information...
commit e16339056d504796040059fc66b9969c59f8b3e4 1 parent 1bd602f
@dchelimsky dchelimsky authored
Showing with 10 additions and 10 deletions.
  1. +10 −10 lib/rspec/mocks/any_instance.rb
View
20 lib/rspec/mocks/any_instance.rb
@@ -30,7 +30,7 @@ def any_instance
modify_dup_to_remove_mock_proxy_when_invoked
__recorder
end
-
+
# @private
def rspec_verify
__recorder.verify
@@ -40,36 +40,36 @@ def rspec_verify
restore_dup
@__recorder = nil
end
-
+
# @private
def rspec_reset
restore_dup
__mock_proxy.reset
end
-
+
# @private
def __recorder
@__recorder ||= AnyInstance::Recorder.new(self)
end
-
+
private
def modify_dup_to_remove_mock_proxy_when_invoked
- if self.method_defined?(:dup) and !self.method_defined?(:__rspec_original_dup)
- self.class_eval do
+ if method_defined?(:dup) and !method_defined?(:__rspec_original_dup)
+ class_eval do
def __rspec_dup
__remove_mock_proxy
__rspec_original_dup
end
-
+
alias_method :__rspec_original_dup, :dup
alias_method :dup, :__rspec_dup
end
end
end
-
+
def restore_dup
- if self.method_defined?(:__rspec_original_dup)
- self.class_eval do
+ if method_defined?(:__rspec_original_dup)
+ class_eval do
alias_method :dup, :__rspec_original_dup
remove_method :__rspec_original_dup
remove_method :__rspec_dup
Please sign in to comment.
Something went wrong with that request. Please try again.