In this example I can see that PollChat_ expectation constructor accepts Predicate, in this case anything. Is there the good way to use IO-like expressions (with side effects) to create predicates (like anything)? Sometimes it would be super useful to call database/webservice hosted in local test environment to verify that argument is genuine. This especially useful in cases where code which is tested is using some sort of randomness involved, for example request should be always unique due dynamically generated nonce and signed on top of it with some private key. I hope I manged to explain the use case. Best regards!
expectAny $
PollChat_ anything
|-> (User "A", "I love Haskell")
|-> (User "B", "Lovin' the ass. candies")
|-> (User "B", "!leave")
In this example I can see that
PollChat_expectation constructor acceptsPredicate, in this caseanything. Is there the good way to use IO-like expressions (with side effects) to create predicates (likeanything)? Sometimes it would be super useful to call database/webservice hosted in local test environment to verify that argument is genuine. This especially useful in cases where code which is tested is using some sort of randomness involved, for example request should be always unique due dynamically generated nonce and signed on top of it with some private key. I hope I manged to explain the use case. Best regards!