Stop using assert_template_result in some tests depending on language extension (#1622)

This commit is contained in:
Dylan Thacker-Smith
2022-09-14 17:03:48 -04:00
committed by GitHub
parent cab08cfe57
commit ff1c35b986
2 changed files with 7 additions and 6 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ class BlankTest < Minitest::Test
def test_new_tags_are_not_blank_by_default
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
+6 -5
View File
@@ -469,8 +469,8 @@ class StandardFiltersTest < Minitest::Test
def test_map_over_proc
drop = TestDrop.new(value: "testfoo")
p = proc { drop }
templ = '{{ procs | map: "value" }}'
assert_template_result("testfoo", templ, { "procs" => [p] })
output = Liquid::Template.parse('{{ procs | map: "value" }}').render!({ "procs" => [p] })
assert_equal("testfoo", output)
end
def test_map_over_drops_returning_procs
@@ -482,12 +482,13 @@ class StandardFiltersTest < Minitest::Test
"proc" => -> { "bar" },
},
]
templ = '{{ drops | map: "proc" }}'
assert_template_result("foobar", templ, { "drops" => drops })
output = Liquid::Template.parse('{{ drops | map: "proc" }}').render!({ "drops" => drops })
assert_equal("foobar", output)
end
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
def test_map_returns_empty_on_2d_input_array