spec icon indicating copy to clipboard operation
spec copied to clipboard

Add test for line number in HEREDOC with method call

Open judofyr opened this issue 1 year ago • 3 comments

This is currently failing in JRuby (see jruby/jruby#7272).

judofyr avatar Feb 10 '24 08:02 judofyr

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!

headius avatar Feb 10 '24 18:02 headius

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?

judofyr avatar Feb 12 '24 13:02 judofyr

That's fine, it's already used in many places, and the CI will notice immediately if the number of lines in between changes.

eregon avatar Feb 12 '24 14:02 eregon

Thank you!

andrykonchin avatar Jun 26 '24 10:06 andrykonchin