Sha256: 960a69ca8df7e9f302cfe790db838ddeb4379704a32ea2a22c9f12802fc80b67

Contents?: true

Size: 589 Bytes

Versions: 4

Compression:

Stored size: 589 Bytes

Contents

require 'helper'

class TestSlimHtmlEscaping < TestSlim
  def test_html_will_not_be_escaped
    source = %q{
p <Hello> World, meet "Slim".
}

    assert_html '<p><Hello> World, meet "Slim".</p>', source
  end

  def test_html_with_newline_will_not_be_escaped
    source = %q{
p
  |
    <Hello> World,
     meet "Slim".
}

    assert_html "<p><Hello> World,\n meet \"Slim\".</p>", source
  end

  def test_html_with_escaped_interpolation
    source = %q{
- x = '"'
- content = '<x>'
p class="#{x}" test #{content}
}

    assert_html '<p class="&quot;">test &lt;x&gt;</p>', source
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
slim-0.9.2 test/slim/test_html_escaping.rb
slim-0.9.1 test/slim/test_html_escaping.rb
slim-0.9.1.alpha.2 test/slim/test_html_escaping.rb
slim-0.9.1.alpha.1 test/slim/test_html_escaping.rb