Add more unit tests

This commit is contained in:
Guilherme Carreiro
2024-09-20 11:28:00 +02:00
parent b397513f8b
commit d7045f9d64
+31 -2
View File
@@ -29,11 +29,11 @@ class SnippetTest < Minitest::Test
def test_render_inline_snippet
template = <<~LIQUID.strip
{% snippet "input" %}
{% snippet "hey" %}
Hey
{% endsnippet %}
{%- render "input" -%}
{%- render "hey" -%}
LIQUID
expected = <<~OUTPUT
@@ -42,4 +42,33 @@ class SnippetTest < Minitest::Test
assert_template_result(expected, template)
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