22 lines
622 B
Swift
22 lines
622 B
Swift
import Spectre
|
|
import Stencil
|
|
|
|
|
|
func testTemplate() {
|
|
describe("Template") {
|
|
$0.it("can render a template from a string") {
|
|
let context = Context(dictionary: [ "name": "Kyle" ])
|
|
let template = Template(templateString: "Hello World")
|
|
let result = try template.render(context)
|
|
try expect(result) == "Hello World"
|
|
}
|
|
|
|
$0.it("can render a template from a string literal") {
|
|
let context = Context(dictionary: [ "name": "Kyle" ])
|
|
let template: Template = "Hello World"
|
|
let result = try template.render(context)
|
|
try expect(result) == "Hello World"
|
|
}
|
|
}
|
|
}
|