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

Merged
merged 3 commits into from
Jun 26, 2024

Conversation

judofyr
Copy link
Contributor

@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
Contributor 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.

@andrykonchin
Copy link
Member

Thank you!

@andrykonchin andrykonchin merged commit e4d2612 into ruby:master Jun 26, 2024
14 checks passed
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.

4 participants