The technique you described later on in the article seems to work properly only with pure functions
It reallly depends, because returns expects you to separate pure code from impure. But, when testing laws with IO, it is expected to work with impure code.
Oh, I see.
It reallly depends, because
returns
expects you to separate pure code from impure. But, when testing laws withIO
, it is expected to work with impure code.This is also the case with
deal
. It even has its own notation for impure code: deal.readthedocs.io/basic/side-eff...For both libs you can set your state for impure code before the actual test. So, it should work correctly.