nanospec-0.2.1: A lightweight implementation of a subset of Hspec's API

Safe HaskellSafe
LanguageHaskell98

Test.Hspec

Contents

Description

A lightweight implementation of a subset of Hspec's API.

Synopsis

Types

data SpecM a #

Instances

Monad SpecM # 

Methods

(>>=) :: SpecM a -> (a -> SpecM b) -> SpecM b #

(>>) :: SpecM a -> SpecM b -> SpecM b #

return :: a -> SpecM a #

fail :: String -> SpecM a #

Functor SpecM # 

Methods

fmap :: (a -> b) -> SpecM a -> SpecM b #

(<$) :: a -> SpecM b -> SpecM a #

Applicative SpecM # 

Methods

pure :: a -> SpecM a #

(<*>) :: SpecM (a -> b) -> SpecM a -> SpecM b #

(*>) :: SpecM a -> SpecM b -> SpecM b #

(<*) :: SpecM a -> SpecM b -> SpecM a #

type Spec = SpecM () #

Defining a spec

Setting expectations

type Expectation = IO () #

shouldBe :: (Show a, Eq a) => a -> a -> Expectation infix 1 #

shouldReturn :: (Show a, Eq a) => IO a -> a -> Expectation infix 1 #

Running a spec

hspec :: Spec -> IO () #