Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve/handling children #28

Merged
merged 6 commits into from
Dec 20, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add test for comparing children
zenangst committed Dec 20, 2016

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 08af9030ca39a7bf3195a9e97cb109890f4ef21e
21 changes: 21 additions & 0 deletions BrickTests/Shared/ItemSpec.swift
Original file line number Diff line number Diff line change
@@ -20,6 +20,10 @@ class ItemSpec: QuickSpec {
"kind" : faker.team.name(),
"size" : ["width" : 320.0, "height" : 240.0],
"action" : faker.internet.ipV6Address(),
"children" : [
"child 1" : "Anna",
"child 2" : "Elsa"
],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bonus points for Frozen reference? 😁

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄

"meta" : [
"domain" : faker.internet.domainName()
]
@@ -185,6 +189,23 @@ class ItemSpec: QuickSpec {
}
}

describe("#compareChildren") {
beforeEach {
item = Item(data)
}

it("compare children properly") {
let sameItem = Item(data)

var newData: [String : Any] = data!
newData["children"] = [["child 1" : "Anna"]]
let otherItem = Item(newData)

expect(item === sameItem).to(beTrue())
expect(item === otherItem).to(beFalse())
}
}

describe("#compareRelations") {
beforeEach {
data["relations"] = ["Items" : [data, data, data]]