Skip to content

Commit

Permalink
Reserve keyword arguments for new options in assert_template_result
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanahsmith committed Sep 1, 2022
1 parent 93c252f commit 0787660
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/integration/tags/if_else_tag_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def test_multiple_conditions
tests.each do |vals, expected|
a, b, c = vals
assigns = { 'a' => a, 'b' => b, 'c' => c }
assert_template_result(expected.to_s, tpl, assigns, assigns.to_s)
assert_template_result(expected.to_s, tpl, assigns, message: assigns.to_s)
end
end
end
12 changes: 3 additions & 9 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,13 @@ def fixture(name)
module Assertions
include Liquid

def assert_template_result(expected, template, assigns = {}, message = nil)
def assert_template_result(expected, template, assigns = {}, message: nil)
assert_equal(expected, Template.parse(template, line_numbers: true).render!(assigns), message)
end

def assert_template_result_matches(expected, template, assigns = {}, message = nil)
return assert_template_result(expected, template, assigns, message) unless expected.is_a?(Regexp)

assert_match(expected, Template.parse(template, line_numbers: true).render!(assigns), message)
end

def assert_match_syntax_error(match, template, assigns = {})
def assert_match_syntax_error(match, template)
exception = assert_raises(Liquid::SyntaxError) do
Template.parse(template, line_numbers: true).render(assigns)
Template.parse(template, line_numbers: true).render
end
assert_match(match, exception.message)
end
Expand Down

0 comments on commit 0787660

Please sign in to comment.