Test Helper

- added assert_template_result_matches
  - fixed indentation / white spacing
This commit is contained in:
DBA 2010-08-23 18:45:04 +08:00 committed by Tobias Lütke
parent 101137045e
commit daf786fd28

View File

@ -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