Skip to content

IO in expectAny expectation constructor predicate #30

@tim2CF

Description

@tim2CF

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions