mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-26 13:45:13 -07:00
Regression test for change of blank? default behaviour (2efe809e11)
This commit is contained in:
@@ -1,5 +1,13 @@
|
|||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
|
class FoobarTag < Liquid::Tag
|
||||||
|
def render(*args)
|
||||||
|
" "
|
||||||
|
end
|
||||||
|
|
||||||
|
Liquid::Template.register_tag('foobar', FoobarTag)
|
||||||
|
end
|
||||||
|
|
||||||
class BlankTestFileSystem
|
class BlankTestFileSystem
|
||||||
def read_template_file(template_path, context)
|
def read_template_file(template_path, context)
|
||||||
template_path
|
template_path
|
||||||
@@ -22,6 +30,10 @@ class BlankTest < Test::Unit::TestCase
|
|||||||
wrap_in_for(body) + wrap_in_if(body)
|
wrap_in_for(body) + wrap_in_if(body)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_new_tags_are_not_blank_by_default
|
||||||
|
assert_template_result(" "*N, wrap_in_for("{% foobar %}"))
|
||||||
|
end
|
||||||
|
|
||||||
def test_loops_are_blank
|
def test_loops_are_blank
|
||||||
assert_template_result("", wrap_in_for(" "))
|
assert_template_result("", wrap_in_for(" "))
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user