Fix typo in "InheritenceSpec"

This commit is contained in:
David Jennes
2018-11-11 17:23:58 +01:00
parent deec93fbe1
commit 9243bba2b7

View File

@@ -0,0 +1,36 @@
import PathKit
import Spectre
import Stencil
import XCTest
final class InheritanceTests: XCTestCase {
let path = Path(#file) + ".." + "fixtures"
lazy var loader = FileSystemLoader(paths: [path])
lazy var environment = Environment(loader: loader)
func testInheritance() {
it("can inherit from another template") {
let template = try self.environment.loadTemplate(name: "child.html")
try expect(try template.render()) == """
Super_Header Child_Header
Child_Body
"""
}
it("can inherit from another template inheriting from another template") {
let template = try self.environment.loadTemplate(name: "child-child.html")
try expect(try template.render()) == """
Super_Header Child_Header Child_Child_Header
Child_Body
"""
}
it("can inherit from a template that calls a super block") {
let template = try self.environment.loadTemplate(name: "child-super.html")
try expect(try template.render()) == """
Header
Child_Body
"""
}
}
}