mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 09:05:13 -07:00
Add more unit tests
This commit is contained in:
@@ -29,11 +29,11 @@ class SnippetTest < Minitest::Test
|
|||||||
|
|
||||||
def test_render_inline_snippet
|
def test_render_inline_snippet
|
||||||
template = <<~LIQUID.strip
|
template = <<~LIQUID.strip
|
||||||
{% snippet "input" %}
|
{% snippet "hey" %}
|
||||||
Hey
|
Hey
|
||||||
{% endsnippet %}
|
{% endsnippet %}
|
||||||
|
|
||||||
{%- render "input" -%}
|
{%- render "hey" -%}
|
||||||
LIQUID
|
LIQUID
|
||||||
expected = <<~OUTPUT
|
expected = <<~OUTPUT
|
||||||
|
|
||||||
@@ -42,4 +42,33 @@ class SnippetTest < Minitest::Test
|
|||||||
|
|
||||||
assert_template_result(expected, template)
|
assert_template_result(expected, template)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_render_multiple_inline_snippets
|
||||||
|
template = <<~LIQUID.strip
|
||||||
|
{% snippet "input" %}
|
||||||
|
<input />
|
||||||
|
{% endsnippet %}
|
||||||
|
|
||||||
|
{% snippet "banner" %}
|
||||||
|
<marquee direction="up" height="100px">
|
||||||
|
Welcome to my store!
|
||||||
|
</marquee>
|
||||||
|
{% endsnippet %}
|
||||||
|
|
||||||
|
{%- render "input" -%}
|
||||||
|
{%- render "banner" -%}
|
||||||
|
LIQUID
|
||||||
|
expected = <<~OUTPUT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<input />
|
||||||
|
|
||||||
|
<marquee direction="up" height="100px">
|
||||||
|
Welcome to my store!
|
||||||
|
</marquee>
|
||||||
|
OUTPUT
|
||||||
|
|
||||||
|
assert_template_result(expected, template)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user