Fix typo in "InheritenceSpec"
This commit is contained in:
36
Tests/StencilTests/InheritanceSpec.swift
Normal file
36
Tests/StencilTests/InheritanceSpec.swift
Normal 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
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user