Use spectre-build for tests

This commit is contained in:
Kyle Fuller
2016-02-02 12:16:43 +00:00
parent 19d712b4a4
commit b4ba12bbde
22 changed files with 621 additions and 579 deletions

View File

@@ -3,21 +3,23 @@ import Stencil
import PathKit
describe("TemplateLoader") {
let path = Path(__FILE__) + ".." + ".." + "Tests" + "fixtures"
let loader = TemplateLoader(paths: [path])
func testTemplateLoader() {
describe("TemplateLoader") {
let path = Path(__FILE__) + ".." + ".." + "Tests" + "fixtures"
let loader = TemplateLoader(paths: [path])
$0.it("returns nil when a template cannot be found") {
try expect(loader.loadTemplate("unknown.html")).to.beNil()
}
$0.it("returns nil when a template cannot be found") {
try expect(loader.loadTemplate("unknown.html")).to.beNil()
}
$0.it("returns nil when an array of templates cannot be found") {
try expect(loader.loadTemplate(["unknown.html", "unknown2.html"])).to.beNil()
}
$0.it("returns nil when an array of templates cannot be found") {
try expect(loader.loadTemplate(["unknown.html", "unknown2.html"])).to.beNil()
}
$0.it("can load a template from a file") {
if loader.loadTemplate("test.html") == nil {
throw failure("didn't find the template")
$0.it("can load a template from a file") {
if loader.loadTemplate("test.html") == nil {
throw failure("didn't find the template")
}
}
}
}