fix(extends): Support multiple extends

Fixes #60
This commit is contained in:
Kyle Fuller
2016-11-27 04:22:37 +00:00
parent a014fecd23
commit 393dc88a10
4 changed files with 30 additions and 8 deletions

View File

@@ -13,5 +13,11 @@ func testInheritence() {
let template = loader.loadTemplate("child.html")
try expect(try template?.render(context)) == "Header\nChild"
}
$0.it("can inherit from another template inheriting from another template") {
let context = Context(dictionary: ["loader": loader])
let template = loader.loadTemplate("child-child.html")
try expect(try template?.render(context)) == "Child Child Header\nChild"
}
}
}

View File

@@ -0,0 +1,2 @@
{% extends "child.html" %}
{% block header %}Child Child Header{% endblock %}