My question is whether there are ways to test two IO actions
in HSpec of Haskell?
Just something like the below example: (The below is wrong because of type)
it "parse examples 0" $ liftM2 shouldBe (tests "ex0in.txt") (tests "ex0Out.txt")
tests :: FileType -> IO (Either String String)
I do not know FileType
, I deal it equals FilePath
.
it "parse examples 0" $ do
ex0in <- liftIO (tests "ex0in.txt")
ex0out <- liftIO (tests "ex0Out.txt")
ex0in `shouldBe` ex0out
it "parse examples 0" $ join $ liftM2 shouldBe (liftIO (tests "ex0in.txt")) (liftIO (tests "ex0Out.txt"))