1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2020-10-24 15:52:37 +02:00
parent 342fbae83c
commit 148961adcd
47 changed files with 725 additions and 61 deletions

View file

@ -59,6 +59,22 @@ HERE
s.encoding.should == Encoding::US_ASCII
end
ruby_version_is "2.7" do
it 'raises SyntaxError if quoted HEREDOC identifier is ending not on same line' do
-> {
eval %{<<"HERE\n"\nraises syntax error\nHERE}
}.should raise_error(SyntaxError)
end
end
ruby_version_is ""..."2.7" do
it 'prints a warning if quoted HEREDOC identifier is ending not on same line' do
-> {
eval %{<<"HERE\n"\nit warns\nHERE}
}.should complain(/here document identifier ends with a newline/)
end
end
it "allows HEREDOC with <<~'identifier', allowing to indent identifier and content" do
require_relative 'fixtures/squiggly_heredoc'
SquigglyHeredocSpecs.message.should == "character density, n.:\n The number of very weird people in the office.\n"