ihumanable / patch

Ergonomic Mocking for Elixir
MIT License
193 stars 11 forks source link

Call will happen assertions / refutations. #29

Closed ihumanable closed 2 years ago

ihumanable commented 2 years ago

ExUnit has assert_receive/3 and assert_received/2.

assert_received/2 asserts that a message is in the message queue.

assert_receive/3 asserts that a message is in the message queue already or will be delivered to the message queue within a given deadline.

Patch has assert_called/1,2 which like assert_received/2 asserts that a call has been observed.

This enhancement would add assert_call/2,3 which would assert that a call has been observed or will be observed within the given deadline.

These present-tense versions could exist for all the call assertions and could perhaps be built on a general use utility function.

ihumanable commented 2 years ago

Going to close this issue for the time being, can always reopen later.