spec
spec copied to clipboard
Add test for line number in HEREDOC with method call
This is currently failing in JRuby (see jruby/jruby#7272).
No need to use eval here; just stick the multi-line heredoc directly into the lambda and use some __LINE__ math for the expectation. Thanks for putting together a spec!
Not sure if __LINE__ math makes it simpler though. That could make it quite fragile? E.g. suddenly it depends on the number of lines between the assertion and the code?
That's fine, it's already used in many places, and the CI will notice immediately if the number of lines in between changes.
Thank you!