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

adds SyntaxError and warning spec for not same line heredoc #794

Merged
merged 3 commits into from
Oct 9, 2020

Conversation

moofkit
Copy link
Contributor

@moofkit moofkit commented Oct 8, 2020

Sub task #745

Quoted here-document identifiers must end within the same line

<<"EOS
" # This had been warned since 2.4; Now it raises a SyntaxError
EOS

eval %{<<"HERE\n"\nHERE}
}.should complain(/here document identifier ends with a newline/)
end
end
Copy link
Member

@andrykonchin andrykonchin Oct 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wording issue. It's common to write just it warns or emits a warning here in the specs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean add the message in heredoc string itself?
If so, check please. I've just added it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No-no. I meant the wording in the spec description - it 'prints a warning. It's not a problem and it's just a matter of taste .

end

ruby_version_is ""..."2.7" do
it 'prints a warning if identifier is ending not on same line' do
Copy link
Member

@andrykonchin andrykonchin Oct 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's missing "quoted identifier"

@moofkit
Copy link
Contributor Author

moofkit commented Oct 9, 2020

@andrykonchin thanks for review so far!

I've just added fixes you mentioned

@andrykonchin
Copy link
Member

Thank you for the new specs.

@andrykonchin andrykonchin merged commit 04716a5 into ruby:master Oct 9, 2020
@moofkit moofkit deleted the heredoc_ending_not_same_line branch October 9, 2020 08:45
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.

2 participants