1
0
Fork 0
mirror of synced 2024-07-04 22:41:10 -04:00
ultimate-vim/sources_non_forked/vim-ruby/spec/syntax/strings/heredoc_spec.rb
201341 cc444efe2c Revert "Merge pull request #1 from 201341/swj/dev"
This reverts commit f93aa0fb39, reversing
changes made to e13b2a10a7.
2021-10-27 11:36:39 +08:00

27 lines
831 B
Ruby

require 'spec_helper'
describe "Syntax highlighting" do
specify "heredocs starting after parenthesised method definitions" do
# See issue #356
assert_correct_highlighting <<~'EOF', 'HTML', 'rubyHeredocDelimiter'
def youtube_video(token, width = 360, height = 215)
<<-HTML if token
<iframe width="#{width}" height="#{height}" src="http://www.youtube.com/embed/#{token}" frameborder="0" allowfullscreen></iframe>
HTML
end
EOF
end
specify "heredocs do not start after string literals" do
assert_correct_highlighting <<~'EOF', 'FOO', 'rubyConstant'
"abc" <<FOO
EOF
assert_correct_highlighting <<~'EOF', 'FOO', 'rubyConstant'
'abc' <<FOO
EOF
assert_correct_highlighting <<~'EOF', 'FOO', 'rubyConstant'
`abc` <<FOO
EOF
end
end