HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulehspec-contrib-0.5.2Haskell2010

Test.Hspec.Contrib.Mocks.V1

  • 2 values
valuestubAction :: HasCallStack => [a] -> IO (IO a)
#

Create a test stub action.

Example5 expressions
stub <- stubAction ["foo", "bar", "baz"]stub"foo"stub"bar"stub"baz"stub*** Exception: HUnitFailure ...stubAction: no values left...
valuewithSpy :: ((a -> IO ()) -> IO ()) -> IO [a]
#

Create a test spy action.

Record any arguments that are passed to that action.

Example1 expression
withSpy $ \ spy -> spy "foo" >> spy "bar" >> spy "baz"["foo","bar","baz"]