Skip to content

Commit

Permalink
Stop using assert_template_result in some tests depending on language…
Browse files Browse the repository at this point in the history
… extension (#1622)
  • Loading branch information
dylanahsmith authored Sep 14, 2022
1 parent cab08cf commit ff1c35b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/integration/blank_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def wrap(body)

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

Expand Down
11 changes: 6 additions & 5 deletions test/integration/standard_filter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,8 @@ def test_sort_calls_to_liquid
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
Expand All @@ -482,12 +482,13 @@ def test_map_over_drops_returning_procs
"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
Expand Down

0 comments on commit ff1c35b

Please sign in to comment.