mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-20 03:10:39 -07:00
Stop using assert_template_result in some tests depending on language extension (#1622)
This commit is contained in:
@@ -27,7 +27,7 @@ class BlankTest < Minitest::Test
|
|||||||
|
|
||||||
def test_new_tags_are_not_blank_by_default
|
def test_new_tags_are_not_blank_by_default
|
||||||
with_custom_tag('foobar', FoobarTag) do
|
with_custom_tag('foobar', FoobarTag) do
|
||||||
assert_template_result(" " * N, wrap_in_for("{% foobar %}"))
|
assert_equal(" " * N, Liquid::Template.parse(wrap_in_for("{% foobar %}")).render!)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -469,8 +469,8 @@ class StandardFiltersTest < Minitest::Test
|
|||||||
def test_map_over_proc
|
def test_map_over_proc
|
||||||
drop = TestDrop.new(value: "testfoo")
|
drop = TestDrop.new(value: "testfoo")
|
||||||
p = proc { drop }
|
p = proc { drop }
|
||||||
templ = '{{ procs | map: "value" }}'
|
output = Liquid::Template.parse('{{ procs | map: "value" }}').render!({ "procs" => [p] })
|
||||||
assert_template_result("testfoo", templ, { "procs" => [p] })
|
assert_equal("testfoo", output)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_map_over_drops_returning_procs
|
def test_map_over_drops_returning_procs
|
||||||
@@ -482,12 +482,13 @@ class StandardFiltersTest < Minitest::Test
|
|||||||
"proc" => -> { "bar" },
|
"proc" => -> { "bar" },
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
templ = '{{ drops | map: "proc" }}'
|
output = Liquid::Template.parse('{{ drops | map: "proc" }}').render!({ "drops" => drops })
|
||||||
assert_template_result("foobar", templ, { "drops" => drops })
|
assert_equal("foobar", output)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_map_works_on_enumerables
|
def test_map_works_on_enumerables
|
||||||
assert_template_result("123", '{{ foo | map: "foo" }}', { "foo" => TestEnumerable.new })
|
output = Liquid::Template.parse('{{ foo | map: "foo" }}').render!({ "foo" => TestEnumerable.new })
|
||||||
|
assert_equal("123", output)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_map_returns_empty_on_2d_input_array
|
def test_map_returns_empty_on_2d_input_array
|
||||||
|
|||||||
Reference in New Issue
Block a user