Fix issues in Tests

t
This commit is contained in:
David Jennes
2018-09-21 00:00:56 +02:00
parent 3f4622f54f
commit 2d82dcb003
19 changed files with 2573 additions and 2454 deletions

View File

@@ -1,38 +1,36 @@
import XCTest
import PathKit
import Spectre
import Stencil
import PathKit
import XCTest
class InheritenceTests: XCTestCase {
func testInheritence() {
describe("Inheritence") {
let path = Path(#file) + ".." + "fixtures"
let loader = FileSystemLoader(paths: [path])
let environment = Environment(loader: loader)
final class InheritanceTests: XCTestCase {
let path = Path(#file) + ".." + "fixtures"
lazy var loader = FileSystemLoader(paths: [path])
lazy var environment = Environment(loader: loader)
$0.it("can inherit from another template") {
let template = try environment.loadTemplate(name: "child.html")
try expect(try template.render()) == """
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
"""
}
}
$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()) == """
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
"""
}
}
$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()) == """
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
"""
}
}
}
}