Permalink
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...
1 parent c1af6e8 commit 8b8d80107b00acccfe33e10c037da9be9e4345b7 @myronmarston myronmarston committed Nov 25, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 lib/rspec/mocks/any_instance/chain.rb
  2. +2 −2 lib/rspec/mocks/any_instance/recorder.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
@@ -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

0 comments on commit 8b8d801

Please sign in to comment.