HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

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"]