mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-20 11:20:41 -07:00
Test Helper
- added assert_template_result_matches - fixed indentation / white spacing
This commit is contained in:
+7
-1
@@ -16,9 +16,15 @@ module Test
|
|||||||
module Assertions
|
module Assertions
|
||||||
include Liquid
|
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).render(assigns)
|
assert_equal expected, Template.parse(template).render(assigns)
|
||||||
end
|
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).render(assigns)
|
||||||
|
end
|
||||||
end # Assertions
|
end # Assertions
|
||||||
|
|
||||||
end # Unit
|
end # Unit
|
||||||
|
|||||||
Reference in New Issue
Block a user