Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fig line arg passed to class_eval so that it's correct.

There contents of the heredoc starts on the next line, hence the need for `+ 1`.
  • Loading branch information...
commit 8b8d80107b00acccfe33e10c037da9be9e4345b7 1 parent c1af6e8
@myronmarston myronmarston authored
View
2  lib/rspec/mocks/any_instance/chain.rb
@@ -13,7 +13,7 @@ class << self
# @see RSpec::Mocks::MessageExpectation#$1
#
def record(method_name)
- class_eval(<<-EOM, __FILE__, __LINE__)
+ class_eval(<<-EOM, __FILE__, __LINE__ + 1)
def #{method_name}(*args, &block)
record(:#{method_name}, *args, &block)
end
View
4 lib/rspec/mocks/any_instance/recorder.rb
@@ -173,7 +173,7 @@ 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__)
+ @klass.class_eval(<<-EOM, __FILE__, __LINE__ + 1)
def #{method_name}(*args, &blk)
klass = ::Object.instance_method(:method).bind(self).call(:#{method_name}).owner
klass.__recorder.playback!(self, :#{method_name})
@@ -184,7 +184,7 @@ def #{method_name}(*args, &blk)
def mark_invoked!(method_name)
backup_method!(method_name)
- @klass.class_eval(<<-EOM, __FILE__, __LINE__)
+ @klass.class_eval(<<-EOM, __FILE__, __LINE__ + 1)
def #{method_name}(*args, &blk)
method_name = :#{method_name}
klass = ::Object.instance_method(:method).bind(self).call(:#{method_name}).owner
Please sign in to comment.
Something went wrong with that request. Please try again.