Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- golden :: (MonadIO m, MonadThrow m, Eq str, Show str) => Golden str -> Free (SpecCommand context m) ()
- goldenText :: String -> Text -> Golden Text
- goldenString :: String -> String -> Golden String
- goldenJSON :: (ToJSON a, FromJSON a) => String -> a -> Golden a
- goldenShowable :: (Show a, Read a) => String -> a -> Golden a
- mkGolden :: (FilePath -> a -> IO ()) -> (FilePath -> IO a) -> String -> a -> Golden a
- goldenOutput :: Golden a -> a
- goldenWriteToFile :: Golden a -> FilePath -> a -> IO ()
- goldenReadFromFile :: Golden a -> FilePath -> IO a
- goldenFile :: Golden a -> FilePath
- goldenActualFile :: Golden a -> Maybe FilePath
- goldenFailFirstTime :: Golden a -> Bool
Main test function
golden :: (MonadIO m, MonadThrow m, Eq str, Show str) => Golden str -> Free (SpecCommand context m) () Source #
Runs a Golden test.
Built-in Goldens.
mkGolden :: (FilePath -> a -> IO ()) -> (FilePath -> IO a) -> String -> a -> Golden a Source #
Make your own Golden
constructor by providing goldenWriteToFile
and goldenReadFromFile
.
Parameters for a Golden
.
goldenOutput :: Golden a -> a Source #
Expected output.
goldenWriteToFile :: Golden a -> FilePath -> a -> IO () Source #
How to write into the golden file the file.
goldenReadFromFile :: Golden a -> FilePath -> IO a Source #
How to read the file.
goldenFile :: Golden a -> FilePath Source #
Where to read/write the golden file for this test.
goldenActualFile :: Golden a -> Maybe FilePath Source #
Where to save the actual file for this test. If it is Nothing
then no file is written.
goldenFailFirstTime :: Golden a -> Bool Source #
Whether to record a failure the first time this test is run.