Copyright | (c) Plow Technologies, 2016 |
---|---|
License | MIT |
Maintainer | soenkehahn@gmail.com, mchaver@gmail.com |
Stability | Alpha |
Safe Haskell | None |
Language | Haskell2010 |
Internal module, use at your own risk.
- apiRoundtripSpecs :: HasGenericSpecs api => Proxy api -> Spec
- apiGoldenSpecs :: HasGenericSpecs api => Proxy api -> Spec
- apiGoldenSpecsWithSettings :: HasGenericSpecs api => Settings -> Proxy api -> Spec
- apiSpecs :: HasGenericSpecs api => Proxy api -> Spec
- apiSpecsWithSettings :: HasGenericSpecs api => Settings -> Proxy api -> Spec
- usedTypes :: HasGenericSpecs api => Proxy api -> [TypeRep]
- mkRoundtripSpecs :: HasGenericSpecs api => Settings -> Proxy api -> [TypeSpec]
- class HasGenericSpecs api where
- data TypeSpec = TypeSpec {}
- class MkTypeSpecs a where
Documentation
apiRoundtripSpecs :: HasGenericSpecs api => Proxy api -> Spec Source #
Allows to obtain roundtrip tests for JSON serialization for all types used
in a servant api. It uses settings
are not used in roundtripSpecs
. There is no need to let the user pass
cusomt settings. It automatically uses defaultSettings
.
See also roundtripSpecs
.
apiGoldenSpecs :: HasGenericSpecs api => Proxy api -> Spec Source #
Allows to obtain golden tests for JSON serialization for all types used in a servant api.
See also goldenSpecs
.
apiGoldenSpecsWithSettings :: HasGenericSpecs api => Settings -> Proxy api -> Spec Source #
Same as apiGoldenSpecs
, but allows custom settings.
apiSpecs :: HasGenericSpecs api => Proxy api -> Spec Source #
Combination of apiRoundtripSpecs
and apiGoldenSpecs
.
apiSpecsWithSettings :: HasGenericSpecs api => Settings -> Proxy api -> Spec Source #
Same as apiSpecs
, but allows custom settings.
mkRoundtripSpecs :: HasGenericSpecs api => Settings -> Proxy api -> [TypeSpec] Source #
Make roundtrip test for all the routes in an API, remove duplicates.
class HasGenericSpecs api where Source #
Allows you to iterate over the routes of a Servant API
http methods
combinators
Data type to for holding tests and type representation of each route in a Servant API. A function can be used to pick which tests to run and return the type name for reference.
class MkTypeSpecs a where Source #
mkTypeSpecs
has to be implemented as a method of a separate class, because we
want to be able to have a specialized implementation for lists.
MkTypeSpecs () Source # | We trust aeson to be correct for (). |
(Typeable * a, Eq a, Show a, Arbitrary a, ToJSON a, FromJSON a) => MkTypeSpecs a Source # | Test JSON Serialization for non-wrapped types. |
(Eq a, Show a, Typeable * a, Arbitrary a, ToJSON a, FromJSON a) => MkTypeSpecs [a] Source # | Test JSON serialization for '[]' types. |
(Eq a, Show a, Typeable * a, Arbitrary a, ToJSON a, FromJSON a) => MkTypeSpecs (Maybe a) Source # | Test JSON serialization for |