mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
Reserve keyword arguments for new options in assert_template_result
This commit is contained in:
@@ -184,7 +184,7 @@ class IfElseTagTest < Minitest::Test
|
||||
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
|
||||
|
||||
+3
-9
@@ -37,19 +37,13 @@ module Minitest
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user