Skip to content

Commit

Permalink
handle ioexceptions in createfiledestination
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterHajdu committed May 22, 2020
1 parent c9003ea commit 17915c8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/Bobek/Test/FileEnvTest.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Bobek.Test.FileEnvTest (fileEnvSpec) where

import Bobek.Destination (PublishResult (..))
import Bobek.FileEnv (createFileSource, readFromFile, serializeMessage, writeToFile)
import Bobek.FileEnv (createFileDestination, createFileSource, readFromFile, serializeMessage, writeToFile)
import Bobek.Message (Message (..))
import Bobek.ReceiveId (ReceiveId (..))
import Bobek.Source (NoMessageReason (..))
Expand Down Expand Up @@ -56,3 +56,8 @@ fileEnvSpec =
$ do
(Left err) <- createFileSource "hopefullynonexistentfile"
err `shouldBe` "hopefullynonexistentfile: openFile: does not exist (No such file or directory)"
describe "createfiledestination"
$ it "should handle io errors during file open"
$ do
result <- createFileDestination "/hopefullynonexistentfile"
isLeft result `shouldBe` True

0 comments on commit 17915c8

Please sign in to comment.