hspec-expectations-lens-0.2.0.0: Hspec expectations for the lens stuff

Safe HaskellNone

Test.Hspec.Expectations.Lens

Contents

Description

Hspec expectations for the lens stuff

Synopsis

Expectations

shouldHave :: Show s => s -> Getting Any s a -> ExpectationSource

x `shouldHave` l sets the expectation that Fold l has non-zero number of targets in x

 shouldHave :: Show s => s -> Getter     s a -> Expectation
 shouldHave :: Show s => s -> Fold       s a -> Expectation
 shouldHave :: Show s => s -> Iso'       s a -> Expectation
 shouldHave :: Show s => s -> Lens'      s a -> Expectation
 shouldHave :: Show s => s -> Traversal' s a -> Expectation
 shouldHave :: Show s => s -> Prism'     s a -> Expectation

shouldNotHave :: Show s => s -> Getting All s a -> ExpectationSource

x `shouldNotHave` l sets the expectation that Fold l has zero targets in x

 shouldNotHave :: Show s => s -> Getter     s a -> Expectation
 shouldNotHave :: Show s => s -> Fold       s a -> Expectation
 shouldNotHave :: Show s => s -> Iso'       s a -> Expectation
 shouldNotHave :: Show s => s -> Lens'      s a -> Expectation
 shouldNotHave :: Show s => s -> Traversal' s a -> Expectation
 shouldNotHave :: Show s => s -> Prism'     s a -> Expectation

shouldView :: (Show s, Show a, Eq a) => s -> a -> Getting a s a -> ExpectationSource

x `shouldView` y `through` l sets the expectation that you can see y in x though a Getter l

 shouldView ::           (Show s, Show a, Eq a) => s -> a -> Getter     s a -> Expectation
 shouldView :: (Monoid m, Show s, Show a, Eq a) => s -> a -> Fold       s m -> Expectation
 shouldView ::           (Show s, Show a, Eq a) => s -> a -> Iso'       s a -> Expectation
 shouldView ::           (Show s, Show a, Eq a) => s -> a -> Lens'      s a -> Expectation
 shouldView :: (Monoid m, Show s, Show a, Eq a) => s -> a -> Traversal' s m -> Expectation
 shouldView :: (Monoid m, Show s, Show a, Eq a) => s -> a -> Prism'     s m -> Expectation

shouldPreview :: (Show s, Show a, Eq a) => s -> a -> Getting (First a) s a -> ExpectationSource

x `shouldPreview` y `through` l sets the expectation that you can list y in x first though a Fold l

 shouldPreview :: (Show s, Show a, Eq a) => s -> a -> Getter     s a -> Expectation
 shouldPreview :: (Show s, Show a, Eq a) => s -> a -> Fold       s a -> Expectation
 shouldPreview :: (Show s, Show a, Eq a) => s -> a -> Lens'      s a -> Expectation
 shouldPreview :: (Show s, Show a, Eq a) => s -> a -> Iso'       s a -> Expectation
 shouldPreview :: (Show s, Show a, Eq a) => s -> a -> Traversal' s a -> Expectation
 shouldPreview :: (Show s, Show a, Eq a) => s -> a -> Prism'     s a -> Expectation

shouldList :: (Show s, Show a, Eq a) => s -> [a] -> Getting (Endo [a]) s a -> ExpectationSource

x `shouldList` ys `through` l sets the expectation that you can list ys in x though a Fold l

 shouldList :: (Show s, Show a, Eq a) => s -> [a] -> Getter     s a -> Expectation
 shouldList :: (Show s, Show a, Eq a) => s -> [a] -> Fold       s a -> Expectation
 shouldList :: (Show s, Show a, Eq a) => s -> [a] -> Lens'      s a -> Expectation
 shouldList :: (Show s, Show a, Eq a) => s -> [a] -> Iso'       s a -> Expectation
 shouldList :: (Show s, Show a, Eq a) => s -> [a] -> Traversal' s a -> Expectation
 shouldList :: (Show s, Show a, Eq a) => s -> [a] -> Prism'     s a -> Expectation

shouldThrow :: IO a -> Getting (First b) SomeException b -> ExpectationSource

x `shouldthrow` l sets the expectation that x throws an exception catchable with a Fold l

Note: name conflicts with shouldThrow

 shouldThrow :: IO a -> -> Getter     s b -> Expectation
 shouldThrow :: IO a -> -> Fold       s b -> Expectation
 shouldThrow :: IO a -> -> Lens'      s b -> Expectation
 shouldThrow :: IO a -> -> Iso'       s b -> Expectation
 shouldThrow :: IO a -> -> Traversal' s b -> Expectation
 shouldThrow :: IO a -> -> Prism'     s b -> Expectation

through :: a -> aSource

A helper to fight parentheses

 through ≡ id
 through :: Int -> Int
 through :: Char -> Char