Sha256: e74deafc26913ece93ae38b0eb54d0c4a413b3867d01123a9dbb7f7188b4ae94

Contents?: true

Size: 483 Bytes

Versions: 15

Compression:

Stored size: 483 Bytes

Contents

require 'test_helper'

class ForTagUnitTest < Minitest::Test
  def test_for_nodelist
    template = Liquid::Template.parse('{% for item in items %}FOR{% endfor %}')
    assert_equal ['FOR'], template.root.nodelist[0].nodelist.map(&:nodelist).flatten
  end

  def test_for_else_nodelist
    template = Liquid::Template.parse('{% for item in items %}FOR{% else %}ELSE{% endfor %}')
    assert_equal ['FOR', 'ELSE'], template.root.nodelist[0].nodelist.map(&:nodelist).flatten
  end
end

Version data entries

15 entries across 15 versions & 4 rubygems

Version Path
liquid-4.0.4 test/unit/tags/for_tag_unit_test.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/liquid-4.0.3/test/unit/tags/for_tag_unit_test.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/liquid-4.0.3/test/unit/tags/for_tag_unit_test.rb
liquid-4.0.3 test/unit/tags/for_tag_unit_test.rb
liquid-4.0.2 test/unit/tags/for_tag_unit_test.rb
liquid-4-0-2-4.0.2 test/unit/tags/for_tag_unit_test.rb
liquid-4.0.1 test/unit/tags/for_tag_unit_test.rb
liquid-4.0.0 test/unit/tags/for_tag_unit_test.rb
liquid-4.0.0.rc3 test/unit/tags/for_tag_unit_test.rb
liquid-4.0.0.rc2 test/unit/tags/for_tag_unit_test.rb
liquid-4.0.0.rc1 test/unit/tags/for_tag_unit_test.rb
locomotivecms-liquid-4.0.0 test/unit/tags/for_tag_unit_test.rb
locomotivecms-liquid-4.0.0.alpha2 test/unit/tags/for_tag_unit_test.rb
locomotivecms-liquid-4.0.0.alpha1 test/unit/tags/for_tag_unit_test.rb
locomotivecms-liquid-4.0.0.alpha test/unit/tags/for_tag_unit_test.rb