refactor: TemplateLoader to protocol, follow Swift API guidelines
This commit is contained in:
@@ -6,17 +6,17 @@ import PathKit
|
||||
func testInheritence() {
|
||||
describe("Inheritence") {
|
||||
let path = Path(#file) + ".." + "fixtures"
|
||||
let loader = TemplateLoader(paths: [path])
|
||||
let loader = FileSystemLoader(paths: [path])
|
||||
|
||||
$0.it("can inherit from another template") {
|
||||
let context = Context(dictionary: ["loader": loader])
|
||||
let template = loader.loadTemplate("child.html")
|
||||
let template = try loader.loadTemplate(name: "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")
|
||||
let template = try loader.loadTemplate(name: "child-child.html")
|
||||
try expect(try template?.render(context)) == "Child Child Header\nChild"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user