feat(filters): Add a join filter

This commit is contained in:
Kyle Fuller
2016-11-27 19:47:50 +00:00
parent dfd57e9571
commit 9fdbbc99e9
5 changed files with 43 additions and 0 deletions

View File

@@ -103,4 +103,13 @@ func testFilter() {
try expect(result) == "Hello World"
}
}
describe("join filter") {
let template = Template(templateString: "{{ value|join:\", \" }}")
$0.it("transforms a string to be lowercase") {
let result = try template.render(Context(dictionary: ["value": ["One", "Two"]]))
try expect(result) == "One, Two"
}
}
}