Skip to content

Commit

Permalink
Make CommonMarker tests pass on Ruby < 2.3
Browse files Browse the repository at this point in the history
<<~ heredocs were not added until Ruby 2.3.
  • Loading branch information
jeremyevans committed Feb 17, 2023
1 parent 1321cd2 commit a467f83
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions test/tilt_commonmarkertemplate_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@

it 'Renders unsafe HTML when :UNSAFE is set' do
template = Tilt::CommonMarkerTemplate.new(UNSAFE: true) do |_t|
<<~MARKDOWN
<div class="alert alert-info full-width">
<h5 class="card-title">TL;DR</h5>
<p>This is an unsafe HTML block</p>
</div>
And then some **other** Markdown
MARKDOWN
<<MARKDOWN
<div class="alert alert-info full-width">
<h5 class="card-title">TL;DR</h5>
<p>This is an unsafe HTML block</p>
</div>
And then some **other** Markdown
MARKDOWN
end

expected = <<~EXPECTED_HTML
<div class="alert alert-info full-width">
<h5 class="card-title">TL;DR</h5>
<p>This is an unsafe HTML block</p>
</div>
<p>And then some <strong>other</strong> Markdown</p>
EXPECTED_HTML
expected = <<EXPECTED_HTML
<div class="alert alert-info full-width">
<h5 class="card-title">TL;DR</h5>
<p>This is an unsafe HTML block</p>
</div>
<p>And then some <strong>other</strong> Markdown</p>
EXPECTED_HTML

assert_match(expected, template.render)
end
Expand Down

0 comments on commit a467f83

Please sign in to comment.