Created
February 21, 2019 11:18
-
-
Save Gryff/d576545121e4936f7fc016c9e2f5b940 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
testPrintStatement :: StateT [Transaction] (Writer String) () | |
testPrintStatement = innerPrintStatement (\statement -> tell statement) | |
it "prints a statement" $ do | |
-- evalStateT works just like evalState, except it will return us a `Writer String ()` instead of just `()` | |
-- we can then use execWriter to get the String from Writer String () | |
execWriter (evalStateT testPrintStatement [Deposit 100, Withdrawal 50]) `shouldBe` "Deposited 100\nWithdrew 50" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment