I currently have the following test code:
testUpdate :: Test testUpdate = testCase "update does change artist" $ do (created, Just revised, parents) <- mbTest $ do Just editor <- fmap entityRef <$> findEditorByName "acid2" created <- create editor startWith let artistId = coreMbid created newRev <- update editor (coreRevision created) expected editId <- openEdit includeRevision editId newRev apply editId found <- findLatest artistId parents <- revisionParents newRev return (created, found, parents) coreData revised @?= expected assertBool "The old revision is a direct parent of the new revision" $ parents == [coreRevision created] where startWith = ... expected = ...
This view works, but it is dirty. I would rather write something without returning the various items under testing, and instead there are statements in which they make sense.
I see that there is an Assertable class, but it looks like I probably have to invent a lot of things.
ocharles
source share