Safe Haskell | Safe-Inferred |
---|---|

Language | Haskell2010 |

Hspec expectations for the lens stuff

- shouldHave :: Show s => s -> ((a -> Const Any a) -> s -> Const Any s) -> Expectation
- shouldNotHave :: Show s => s -> ((a -> Const Any a) -> s -> Const Any s) -> Expectation
- shouldView :: (Show s, Show a, Eq a) => s -> a -> ((a -> Const a a) -> s -> Const a s) -> Expectation
- shouldPreview :: (Show s, Show a, Eq a) => s -> a -> ((a -> Const (First a) a) -> s -> Const (First a) s) -> Expectation
- shouldList :: (Show s, Show a, Eq a) => s -> [a] -> ((a -> Const (Endo [a]) a) -> s -> Const (Endo [a]) s) -> Expectation
- through :: a -> a

# Expectations

shouldHave :: Show s => s -> ((a -> Const Any a) -> s -> Const Any s) -> Expectation infixl 1 Source

`x `shouldHave` l`

sets the expectation that `Fold`

`l`

has
non-zero number of targets in `x`

shouldNotHave :: Show s => s -> ((a -> Const Any a) -> s -> Const Any s) -> Expectation infixl 1 Source

`x `shouldNotHave` l`

sets the expectation that `Fold`

`l`

has zero targets in `x`

shouldView :: (Show s, Show a, Eq a) => s -> a -> ((a -> Const a a) -> s -> Const a s) -> Expectation infixl 1 Source

`x `shouldView` y `through` l`

sets the expectation that
you can see `y`

in `x`

though a `Getter`

`l`

shouldPreview :: (Show s, Show a, Eq a) => s -> a -> ((a -> Const (First a) a) -> s -> Const (First a) s) -> Expectation infixl 1 Source

`x `shouldPreview` y `through` l`

sets the expectation that
you can list `y`

in `x`

first though a `Fold`

`l`

shouldList :: (Show s, Show a, Eq a) => s -> [a] -> ((a -> Const (Endo [a]) a) -> s -> Const (Endo [a]) s) -> Expectation infixl 1 Source

`x `shouldList` ys `through` l`

sets the expectation that
you can list `ys`

in `x`

though a `Fold`

`l`