Sha256: c36894e7d267195305f4bcf10ae32bbd9cc60a86356ebb6fdaa0a9d8776d3357

Contents?: true

Size: 1.16 KB

Versions: 11

Compression:

Stored size: 1.16 KB

Contents

require 'test_helper'

class RawTagTest < Minitest::Test
  include Liquid

  def test_tag_in_raw
    assert_template_result '{% comment %} test {% endcomment %}',
                           '{% raw %}{% comment %} test {% endcomment %}{% endraw %}'
  end

  def test_output_in_raw
    assert_template_result '{{ test }}', '{% raw %}{{ test }}{% endraw %}'
  end

  def test_open_tag_in_raw
    assert_template_result ' Foobar {% invalid ', '{% raw %} Foobar {% invalid {% endraw %}'
    assert_template_result ' Foobar invalid %} ', '{% raw %} Foobar invalid %} {% endraw %}'
    assert_template_result ' Foobar {{ invalid ', '{% raw %} Foobar {{ invalid {% endraw %}'
    assert_template_result ' Foobar invalid }} ', '{% raw %} Foobar invalid }} {% endraw %}'
    assert_template_result ' Foobar {% invalid {% {% endraw ', '{% raw %} Foobar {% invalid {% {% endraw {% endraw %}'
    assert_template_result ' Foobar {% {% {% ', '{% raw %} Foobar {% {% {% {% endraw %}'
    assert_template_result ' test {% raw %} {% endraw %}', '{% raw %} test {% raw %} {% {% endraw %}endraw %}'
    assert_template_result ' Foobar {{ invalid 1', '{% raw %} Foobar {{ invalid {% endraw %}{{ 1 }}'
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
locomotivecms-liquid-4.0.0 test/integration/tags/raw_tag_test.rb
liquid-3.0.6 test/integration/tags/raw_tag_test.rb
liquid-3.0.5 test/integration/tags/raw_tag_test.rb
liquid-3.0.4 test/integration/tags/raw_tag_test.rb
liquid-3.0.3 test/integration/tags/raw_tag_test.rb
liquid-3.0.2 test/integration/tags/raw_tag_test.rb
locomotivecms-liquid-4.0.0.alpha2 test/integration/tags/raw_tag_test.rb
locomotivecms-liquid-4.0.0.alpha1 test/integration/tags/raw_tag_test.rb
locomotivecms-liquid-4.0.0.alpha test/integration/tags/raw_tag_test.rb
liquid-3.0.1 test/integration/tags/raw_tag_test.rb
liquid-3.0.0 test/integration/tags/raw_tag_test.rb