Hi,
Assuming you want to receive the same message, wouldn't this only be
slightly shorter than using
```
for _ <- 1..3, do: assert_receive({"msg", _})
```
- Sven
On Thu, 6 Dec 2018 at 14:25 Anastasiya Dyachenko <[email protected]>
wrote:
> Hi,
> In tests often face with need to write code like
> ```
> assert_receive {"msg", _}
> assert_receive {"msg", _}
> assert_receive {"msg", _}
> ```
> where same messages or same matching messages expected to receive multiple
> times.
> It would be match better to have ability to set number of times message
> must be received, like
>
> ```
> assert_receive {"msg", _}, 5_000, "message", 3
> ```
> or
> ```
> assert_receive {"msg", _}, times: 3, timeout: 5_000, message: "message"
> ```
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/1ab2968a-9a6c-444f-b9e2-ab164c9673ad%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/1ab2968a-9a6c-444f-b9e2-ab164c9673ad%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elixir-lang-core/CAFuVuxwqdbV27OY-GAhP02jbCiY%3D_VVDdjRSDX1771fnj%3DudUg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.