refactor: Use tabs for indent

This commit is contained in:
T. R. Bernstein
2025-09-30 19:02:50 +02:00
parent 6811c71bd6
commit 25d1507159
44 changed files with 5423 additions and 5423 deletions

View File

@@ -4,52 +4,52 @@ import Stencil
import XCTest
final class TemplateLoaderTests: XCTestCase {
func testFileSystemLoader() {
let path = Path(#file as String)! / ".." / "fixtures"
let loader = FileSystemLoader(paths: [path])
let environment = Environment(loader: loader)
func testFileSystemLoader() {
let path = Path(#file as String)! / ".." / "fixtures"
let loader = FileSystemLoader(paths: [path])
let environment = Environment(loader: loader)
it("errors when a template cannot be found") {
try expect(try environment.loadTemplate(name: "unknown.html")).toThrow()
}
it("errors when a template cannot be found") {
try expect(try environment.loadTemplate(name: "unknown.html")).toThrow()
}
it("errors when an array of templates cannot be found") {
try expect(try environment.loadTemplate(names: ["unknown.html", "unknown2.html"])).toThrow()
}
it("errors when an array of templates cannot be found") {
try expect(try environment.loadTemplate(names: ["unknown.html", "unknown2.html"])).toThrow()
}
it("can load a template from a file") {
_ = try environment.loadTemplate(name: "test.html")
}
it("can load a template from a file") {
_ = try environment.loadTemplate(name: "test.html")
}
it("errors when loading absolute file outside of the selected path") {
try expect(try environment.loadTemplate(name: "/etc/hosts")).toThrow()
}
it("errors when loading absolute file outside of the selected path") {
try expect(try environment.loadTemplate(name: "/etc/hosts")).toThrow()
}
it("errors when loading relative file outside of the selected path") {
try expect(try environment.loadTemplate(name: "../LoaderSpec.swift")).toThrow()
}
}
it("errors when loading relative file outside of the selected path") {
try expect(try environment.loadTemplate(name: "../LoaderSpec.swift")).toThrow()
}
}
func testDictionaryLoader() {
let loader = DictionaryLoader(templates: [
"index.html": "Hello World"
])
let environment = Environment(loader: loader)
func testDictionaryLoader() {
let loader = DictionaryLoader(templates: [
"index.html": "Hello World"
])
let environment = Environment(loader: loader)
it("errors when a template cannot be found") {
try expect(try environment.loadTemplate(name: "unknown.html")).toThrow()
}
it("errors when a template cannot be found") {
try expect(try environment.loadTemplate(name: "unknown.html")).toThrow()
}
it("errors when an array of templates cannot be found") {
try expect(try environment.loadTemplate(names: ["unknown.html", "unknown2.html"])).toThrow()
}
it("errors when an array of templates cannot be found") {
try expect(try environment.loadTemplate(names: ["unknown.html", "unknown2.html"])).toThrow()
}
it("can load a template from a known templates") {
_ = try environment.loadTemplate(name: "index.html")
}
it("can load a template from a known templates") {
_ = try environment.loadTemplate(name: "index.html")
}
it("can load a known template from a collection of templates") {
_ = try environment.loadTemplate(names: ["unknown.html", "index.html"])
}
}
it("can load a known template from a collection of templates") {
_ = try environment.loadTemplate(names: ["unknown.html", "index.html"])
}
}
}