Skip to content
This repository has been archived by the owner on May 20, 2021. It is now read-only.

Commit

Permalink
Use custom verification for set
Browse files Browse the repository at this point in the history
Since order of a set is not guaranteed, we cannot assume the order of the
array resulting from wrapping a set.
  • Loading branch information
JohnSundell committed Feb 24, 2017
1 parent 844c3d0 commit 129142c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Tests/WrapTests/WrapTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,14 @@ class WrapTests: XCTestCase {
}

do {
try verify(dictionary: wrap(Model()), againstDictionary: [
"set" : ["Wrap", "Tests"]
])
let dictionary: WrappedDictionary = try wrap(Model())
XCTAssertEqual(dictionary.count, 1)

guard let array = dictionary["set"] as? [String] else {
return XCTFail("Expected array for key \"set\"")
}

XCTAssertEqual(Set(array), ["Wrap", "Tests"])
} catch {
XCTFail(error.toString())
}
Expand Down

0 comments on commit 129142c

Please sign in to comment.