Created
March 14, 2015 06:27
-
-
Save aph5nt/5dd1a866e7e2efb24bae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let findOk result item = | |
result | |
|> successTee (fun (obj, msgs) -> | |
let found = msgs |> List.toSeq |> Seq.tryFind (fun(m) -> m = item) | |
match found with | |
| Some msg -> msg |> should be (sameAs item) | |
| None -> failwith(sprintf "%s not found" item) | |
) | |
let findFailure result item = | |
result | |
|> failureTee (fun (msgs) -> | |
let found = msgs |> List.toSeq |> Seq.tryFind (fun(m) -> m = item) | |
match found with | |
| Some msg -> msg |> should be (sameAs item) | |
| None -> failwith(sprintf "%s not found" item) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment