chuchu-0.2.1: Behaviour Driven Development like Cucumber for Haskell

Portabilitynon-portable (GADTs, GeneralizedNewtypeDeriving)
MaintainerMarco Túlio Pimenta Gontijo <>
Safe HaskellNone






newtype ChuchuParser a Source

newtype for Parsec's Parser used on this library. The main reason for not using Parser directly is to be able to define the IsString instance.


ChuchuParser (Parser a) 

type Chuchu m = ChuchuM m ()Source

The most common use case where the return value of the Monad is ignored.

data ChuchuM m a whereSource

The Monad on which the step rules are constructed. Given, When, Then, And and But are interpreted in the same way by the program. All of them receive a parser and an action to run if the parser finishes correctly.


Given :: ChuchuParser a -> (a -> m ()) -> ChuchuM m () 
When :: ChuchuParser a -> (a -> m ()) -> ChuchuM m () 
Then :: ChuchuParser a -> (a -> m ()) -> ChuchuM m () 
And :: ChuchuParser a -> (a -> m ()) -> ChuchuM m () 
But :: ChuchuParser a -> (a -> m ()) -> ChuchuM m () 


runChuchu :: ChuchuM m a -> Parser (m ())Source

Converts the Monad into a single Parser that executes the specified action if the parser is executed correctly. It includes an eof on the parser of each step to avoid it from accepting prefixes of the desired rule.