tags: use scope.opts insteadof scope.get('liquid')

This commit is contained in:
harttle
2017-11-04 10:46:15 +08:00
parent 329aea6bd6
commit 4e132ca1c5
8 changed files with 79 additions and 73 deletions
+16 -6
View File
@@ -24,13 +24,23 @@ describe('tags/layout', function () {
return expect(liquid.parseAndRender(src)).to
.be.rejectedWith(/tag {%block%} not closed/)
})
it('should handle anonymous block', function () {
mock({
'/parent.html': 'X{%block%}{%endblock%}Y'
describe('anonymous block', function () {
it('should handle anonymous block', function () {
mock({
'/parent.html': 'X{%block%}{%endblock%}Y'
})
var src = '{% layout "parent.html" %}{%block%}A{%endblock%}'
return expect(liquid.parseAndRender(src)).to
.eventually.equal('XAY')
})
it('should handle top level contents as anonymous block', function () {
mock({
'/parent.html': 'X{%block%}{%endblock%}Y'
})
var src = '{% layout "parent.html" %}A'
return expect(liquid.parseAndRender(src)).to
.eventually.equal('XAY')
})
var src = '{% layout "parent.html" %}{%block%}A{%endblock%}'
return expect(liquid.parseAndRender(src)).to
.eventually.equal('XAY')
})
it('should handle named blocks', function () {
mock({