| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Test.Hspec.Expectations.Lens
Contents
Description
Hspec expectations for the lens stuff
- shouldHave :: Show s => s -> Getting Any s a -> Expectation
- shouldNotHave :: Show s => s -> Getting All s a -> Expectation
- shouldView :: (Show s, Show a, Eq a) => s -> a -> Getting a s a -> Expectation
- shouldPreview :: (Show s, Show a, Eq a) => s -> a -> Getting (First a) s a -> Expectation
- shouldList :: (Show s, Show a, Eq a) => s -> [a] -> Getting (Endo [a]) s a -> Expectation
- shouldThrow :: IO a -> Getting (First b) SomeException b -> Expectation
- through :: a -> a
Expectations
shouldHave :: Show s => s -> Getting Any s a -> Expectation infixl 1 Source
x `shouldHave` l sets the expectation that Fold l has
non-zero number of targets in x
shouldHave ::Shows => s ->Getters a ->ExpectationshouldHave ::Shows => s ->Folds a ->ExpectationshouldHave ::Shows => s ->Iso's a ->ExpectationshouldHave ::Shows => s ->Lens's a ->ExpectationshouldHave ::Shows => s ->Traversal's a ->ExpectationshouldHave ::Shows => s ->Prism's a ->Expectation
shouldNotHave :: Show s => s -> Getting All s a -> Expectation infixl 1 Source
x `shouldNotHave` l sets the expectation that Fold l
has zero targets in x
shouldNotHave ::Shows => s ->Getters a ->ExpectationshouldNotHave ::Shows => s ->Folds a ->ExpectationshouldNotHave ::Shows => s ->Iso's a ->ExpectationshouldNotHave ::Shows => s ->Lens's a ->ExpectationshouldNotHave ::Shows => s ->Traversal's a ->ExpectationshouldNotHave ::Shows => s ->Prism's a ->Expectation
shouldView :: (Show s, Show a, Eq a) => s -> a -> Getting a s a -> Expectation infixl 1 Source
x `shouldView` y `through` l sets the expectation that
you can see y in x though a Getter l
shouldView :: (Shows,Showa,Eqa) => s -> a ->Getters a ->ExpectationshouldView :: (Monoidm,Shows,Showa,Eqa) => s -> a ->Folds m ->ExpectationshouldView :: (Shows,Showa,Eqa) => s -> a ->Iso's a ->ExpectationshouldView :: (Shows,Showa,Eqa) => s -> a ->Lens's a ->ExpectationshouldView :: (Monoidm,Shows,Showa,Eqa) => s -> a ->Traversal's m ->ExpectationshouldView :: (Monoidm,Shows,Showa,Eqa) => s -> a ->Prism's m ->Expectation
shouldPreview :: (Show s, Show a, Eq a) => s -> a -> Getting (First a) s a -> Expectation infixl 1 Source
x `shouldPreview` y `through` l sets the expectation that
you can list y in x first though a Fold l
shouldPreview :: (Shows,Showa,Eqa) => s -> a ->Getters a ->ExpectationshouldPreview :: (Shows,Showa,Eqa) => s -> a ->Folds a ->ExpectationshouldPreview :: (Shows,Showa,Eqa) => s -> a ->Lens's a ->ExpectationshouldPreview :: (Shows,Showa,Eqa) => s -> a ->Iso's a ->ExpectationshouldPreview :: (Shows,Showa,Eqa) => s -> a ->Traversal's a ->ExpectationshouldPreview :: (Shows,Showa,Eqa) => s -> a ->Prism's a ->Expectation
shouldList :: (Show s, Show a, Eq a) => s -> [a] -> Getting (Endo [a]) s a -> Expectation infixl 1 Source
x `shouldList` ys `through` l sets the expectation that
you can list ys in x though a Fold l
shouldList :: (Shows,Showa,Eqa) => s -> [a] ->Getters a ->ExpectationshouldList :: (Shows,Showa,Eqa) => s -> [a] ->Folds a ->ExpectationshouldList :: (Shows,Showa,Eqa) => s -> [a] ->Lens's a ->ExpectationshouldList :: (Shows,Showa,Eqa) => s -> [a] ->Iso's a ->ExpectationshouldList :: (Shows,Showa,Eqa) => s -> [a] ->Traversal's a ->ExpectationshouldList :: (Shows,Showa,Eqa) => s -> [a] ->Prism's a ->Expectation
shouldThrow :: IO a -> Getting (First b) SomeException b -> Expectation infixl 1 Source
x `shouldthrow` l sets the expectation that
x throws an exception catchable with a Fold l
Note: name conflicts with shouldThrow
shouldThrow ::IOa -> ->Getters b ->ExpectationshouldThrow ::IOa -> ->Folds b ->ExpectationshouldThrow ::IOa -> ->Lens's b ->ExpectationshouldThrow ::IOa -> ->Iso's b ->ExpectationshouldThrow ::IOa -> ->Traversal's b ->ExpectationshouldThrow ::IOa -> ->Prism's b ->Expectation