fixed block inheritance with several levels

This commit is contained in:
Ilya Puchka
2017-11-29 23:03:16 +01:00
parent cf7acea440
commit 93c07e22b1
6 changed files with 39 additions and 13 deletions

View File

@@ -11,17 +11,17 @@ func testInheritence() {
$0.it("can inherit from another template") {
let template = try environment.loadTemplate(name: "child.html")
try expect(try template.render()) == "Header\nChild"
try expect(try template.render()) == "Super_Header Child_Header\nChild_Body"
}
$0.it("can inherit from another template inheriting from another template") {
let template = try environment.loadTemplate(name: "child-child.html")
try expect(try template.render()) == "Child Child Header\nChild"
try expect(try template.render()) == "Super_Header Child_Header Child_Child_Header\nChild_Body"
}
$0.it("can inherit from a template that calls a super block") {
let template = try environment.loadTemplate(name: "child-super.html")
try expect(try template.render()) == "Header\nChild Body"
try expect(try template.render()) == "Header\nChild_Body"
}
}
}