ruby / spec

The Ruby Spec Suite aka ruby/spec
MIT License
588 stars 384 forks source link

Add test for line number in HEREDOC with method call #1135

Closed judofyr closed 3 weeks ago

judofyr commented 5 months ago

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

headius commented 5 months ago

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!

judofyr commented 5 months ago

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?

eregon commented 5 months ago

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

andrykonchin commented 3 weeks ago

Thank you!