Skip to content

Commit

Permalink
added test for rendering template with boolean expression
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyapuchka committed Dec 26, 2017
1 parent 594f603 commit 22ec16b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Tests/StencilTests/ExpressionSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ func testExpressions() {

$0.it("can resolve variable") {
let context = Context(dictionary: ["value": "known"])
try expect(try expression.resolve(context) as? String) == "known"
try expect(expression.resolve(context) as? String) == "known"

try expect(Template(templateString: "{{ value == \"known\" }}").render(["value": "known"])) == "true"
try expect(Template(templateString: "{{ value == \"known\" }}").render(["value": "unknown"])) == "false"
}

$0.it("evaluates to true when value is not nil") {
Expand Down

0 comments on commit 22ec16b

Please sign in to comment.