feat(context): Add flatten method

This commit is contained in:
Kyle Fuller
2016-11-28 05:51:27 +00:00
parent 429290e0b7
commit 1975cfd627
4 changed files with 74 additions and 0 deletions

View File

@@ -58,5 +58,15 @@ func testContext() {
try expect(didRun).to.beTrue()
try expect(context["name"] as? String) == "Kyle"
}
$0.it("allows you to flatten the context contents") {
try context.push(dictionary: ["test": "abc"]) {
let flattened = context.flatten()
try expect(flattened.count) == 2
try expect(flattened["name"] as? String) == "Kyle"
try expect(flattened["test"] as? String) == "abc"
}
}
}
}