mirror of
https://github.com/Shopify/liquid.git
synced 2025-11-22 00:02:48 -05:00
Test Helper
- added assert_template_result_matches - fixed indentation / white spacing
This commit is contained in:
parent
101137045e
commit
daf786fd28
@ -16,9 +16,15 @@ module Test
|
||||
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).render(assigns)
|
||||
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 # Unit
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user