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

Matcher for reading from channels #21

Open
poy opened this issue Nov 13, 2016 · 0 comments
Open

Matcher for reading from channels #21

poy opened this issue Nov 13, 2016 · 0 comments

Comments

@poy
Copy link
Collaborator

poy commented Nov 13, 2016

Often we are asserting on reading from a channel. It would be useful to have one that could read from channel and make further assertions on the result.

e.g.

c := make(chan int, 100)
// ...
expect(c).To.Receive().And.Equal(90)

This example has more than just the Receive functionality. It also includes some chaining. If is distasteful, then maybe the following would be more palatable:

c := make(chan int, 100)
// ...
expect(c).To.Receive(&i).Else.FailNow()
expect(i).To.Equal(90)
@poy poy mentioned this issue Nov 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant