chuchu-0.4.5: Behaviour Driven Development like Cucumber for Haskell

Portabilitynon-portable (GADTs, GeneralizedNewtypeDeriving)
Stabilityunstable
MaintainerMarco Túlio Pimenta Gontijo <marcotmarcot@gmail.com>
Safe HaskellNone

Test.Chuchu.Types

Description

 

Synopsis

Documentation

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.

Constructors

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.

Constructors

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 () 

Instances

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.