Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

judofyr
Copy link

@judofyr judofyr commented Feb 10, 2024

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

@headius
Copy link
Contributor

headius commented Feb 10, 2024

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
Copy link
Author

judofyr commented Feb 12, 2024

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
Copy link
Member

eregon commented Feb 12, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants