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

RTL8 #219

Merged
merged 2 commits into from
Feb 18, 2016
Merged

RTL8 #219

merged 2 commits into from
Feb 18, 2016

Conversation

ricardopereira
Copy link
Contributor

No description

channel1.publish(nil, data: "message")
channel1.publish(nil, data: "message")

expect(Test.counter).toEventually(equal(3), timeout: testTimeout)
Copy link
Member

Choose a reason for hiding this comment

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

I really don't like the readability of the test. Why not simply set up one channel, subscribe, publish and check that message is received. Then unsubscribe and check that no message is received? This is overly complex and I don't really follow why one channel unsubscribes whilst the other one doesn't.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you right. I will simplify.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


// If `unsubscribe` fails then the test suite will raise "Done closure's was called multiple times."
waitUntil(timeout: testTimeout) { done in
delay(5.0) { done() }
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please make this delay much smaller and move it to the callback of the second channel.publish? The test suite is already way too slow as it is...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@tcard
Copy link
Contributor

tcard commented Feb 17, 2016

LGTM

waitUntil(timeout: testTimeout) { done in
channel.publish(nil, data: "message") { errorInfo in
expect(errorInfo).to(beNil())
// If `unsubscribe` fails then the test suite will raise "Done closure's was called multiple times."
Copy link
Member

Choose a reason for hiding this comment

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

This test is unnecessarily complex because of this. Why are we testing publish on line 628 at all. Surely we just add a listener, and the unsubscribe the listener. We have other tests to test that the listener registration works, so if we don't test something that this test is not about, you can instead raise an error in the listener block because we never expect it to be called.

ricardopereira added a commit that referenced this pull request Feb 18, 2016
@ricardopereira ricardopereira merged commit b849e8f into master Feb 18, 2016
@ricardopereira ricardopereira deleted the RTL8 branch February 19, 2016 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants