monad-mock alternatives and similar packages
Based on the "Testing" category.
Alternatively, view monad-mock alternatives based on common mentions on social networks and blogs.
-
hedgehog
Release with confidence, state-of-the-art property testing for Haskell. -
quickcheck-state-machine
Test monadic programs using state machine based models -
curl-runnings
A declarative test framework for quickly and easily writing integration tests against JSON API's. -
smallcheck
Test your Haskell code by exhaustively checking its properties -
ghc-prof-flamegraph
Generates data to be used with flamegraph.pl from .prof files. -
test-framework
Framework for running and organising QuickCheck test properties and HUnit test cases -
fuzzcheck
A library for testing monadic code in the spirit of QuickCheck -
tasty-hedgehog
Tasty integration for the Hedgehog property testing library -
should-not-typecheck
A HUnit/hspec assertion to verify that an expression does not typecheck -
hspec-expectations-json
Hspec expectations on JSON Values -
quickcheck-arbitrary-adt
Typeclass for generating a list of each instance of a sum type's constructors -
hspec-golden-aeson
Use tests to monitor changes in Aeson serialization -
tasty-expected-failure
Mark test cases as expected-failure -
test-framework-th
Automagically (using Template Haskell) generates the Haskell-code you need when using HUnit -
tasty-rerun
Rerun previous test suite runs to run only failing tests -
test-framework-sandbox
test-sandbox support for the test-framework package -
markov-chain-usage-model
Computations for Markov chain usage models
Collect and Analyze Billions of Data Points in Real Time
Do you think we are missing an alternative of monad-mock or a related project?
README
monad-mock 
monad-mock
is a Haskell package that provides a monad transformer to help create “mocks” of mtl
-style typeclasses, intended for use in unit tests. A mock can be executed by providing a sequence of expected monadic calls and their results, and the mock will verify that the computation conforms to the expectation.
For example, imagine a MonadFileSystem
typeclass, which describes a class of
monads that may perform filesystem operations:
class Monad m => MonadFileSystem m where
readFile :: FilePath -> m String
writeFile :: FilePath -> String -> m ()
Using MockT
, it’s possible to test computations that use MonadFileSystem
in a completely pure way:
copyFile :: MonadFileSystem m => FilePath -> FilePath -> m ()
copyFile a b = do
x <- readFile a
writeFile b x
makeMock "FileSystemAction" [ts| MonadFileSystem |]
spec = describe "copyFile" $
it "reads a file and writes its contents to another file" $
evaluate $ copyFile "foo.txt" "bar.txt"
& runMock [ ReadFile "foo.txt" :-> "contents"
, WriteFile "bar.txt" "contents" :-> () ]
For more information, see the documentation on Hackage.