Skip to content

Commit

Permalink
test another location
Browse files Browse the repository at this point in the history
  • Loading branch information
sl4vr committed Jul 8, 2020
1 parent 2d63428 commit 62c3a15
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/rubocop/rspec/language/runtime_macros.rb
Expand Up @@ -19,7 +19,8 @@ def def_runtime_node_matcher(method_name, &pattern_block)
"#{predicate_method?(method_name) ? '!match.nil?' : 'match'};" \
'end'

location = caller_locations(1, 1).first
location = caller_locations(3, 1).first
puts location
class_eval(src, location.path, location.lineno)
end

Expand All @@ -34,7 +35,7 @@ def def_runtime_node_search(method_name, &pattern_block)
"node.each_node.public_method(#{search_method})" \
'.call(&pattern.public_method(:match, *args, &block));end'

location = caller_locations(1, 1).first
location = caller_locations(2, 1).first
class_eval(src, location.path, location.lineno)
end

Expand Down

0 comments on commit 62c3a15

Please sign in to comment.