hspec-golden-aeson-0.7.0.0: Use tests to monitor changes in Aeson serialization

Copyright(c) Plow Technologies 2016
LicenseBSD3
Maintainermchaver@gmail.com
StabilityBeta
Safe HaskellNone
LanguageHaskell2010

Test.Aeson.Internal.Utils

Description

 
Synopsis

Documentation

data ComparisonFile #

Option to indicate whether to create a separate comparison file or overwrite the golden file. A separate file allows you to use diff to compare. Overwriting allows you to use source control tools for comparison.

Constructors

FaultyFile

Create a new faulty file when tests fail

OverwriteGoldenFile

Overwrite the golden file when tests fail

data RandomMismatchOption #

Option indicating whether to fail tests when the random seed does not produce the same values as in the golden file. Default is to output a warning.

Constructors

RandomMismatchWarning

Only output a warning when the random seed does not produce the same values

RandomMismatchError

Fail the test when the random seed does not produce the same value

data Settings #

Constructors

Settings 

Fields

data GoldenDirectoryOption #

A custom directory name or a preselected directory name.

defaultSettings :: Settings #

The default settings for general use cases.

addBrackets :: String -> String #

put brackets around a String.

shouldBeIdentity :: (Eq a, Show a, Arbitrary a) => Proxy a -> (a -> IO a) -> Property #

hspec style combinator to easily write tests that check the a given operation returns the same value it was given, e.g. roundtrip tests.

checkAesonEncodingEquality :: forall a. (ToJSON a, FromJSON a) => JsonShow a -> Bool #

This function will compare one JSON encoding to a subsequent JSON encoding, thus eliminating the need for an Eq instance

aesonDecodeIO :: FromJSON a => ByteString -> IO a #

run decode in IO, if it returns Left then throw an error.

newtype JsonShow a #

Used to eliminate the need for an Eq instance

Constructors

JsonShow a 
Instances
ToJSON a => Show (JsonShow a) # 
Instance details

Defined in Test.Aeson.Internal.Utils

Methods

showsPrec :: Int -> JsonShow a -> ShowS #

show :: JsonShow a -> String #

showList :: [JsonShow a] -> ShowS #

Arbitrary a => Arbitrary (JsonShow a) # 
Instance details

Defined in Test.Aeson.Internal.Utils

Methods

arbitrary :: Gen (JsonShow a) #

shrink :: JsonShow a -> [JsonShow a] #

ToJSON a => ToJSON (JsonShow a) # 
Instance details

Defined in Test.Aeson.Internal.Utils

FromJSON a => FromJSON (JsonShow a) # 
Instance details

Defined in Test.Aeson.Internal.Utils

newtype TopDir #

Constructors

TopDir 

Fields

Instances
Eq TopDir # 
Instance details

Defined in Test.Aeson.Internal.Utils

Methods

(==) :: TopDir -> TopDir -> Bool #

(/=) :: TopDir -> TopDir -> Bool #

Read TopDir # 
Instance details

Defined in Test.Aeson.Internal.Utils

Show TopDir # 
Instance details

Defined in Test.Aeson.Internal.Utils

newtype TypeName #

Constructors

TypeName 

Fields

mkTypeNameInfo :: forall a. Arbitrary a => Typeable a => Settings -> Proxy a -> IO (TypeNameInfo a) #