skeletest-0.4.0: Batteries-included, opinionated test framework
Safe HaskellNone
LanguageGHC2021

Skeletest.Internal.Fixtures

Synopsis

Documentation

getFixture :: (Fixture a, MonadIO m) => m a Source #

Load a fixture, initializing it if it hasn't been cached already.

Cleanup

data FixtureCleanup Source #

Constructors

NoCleanup 
CleanupFunc (IO ()) 

noCleanup :: a -> (a, FixtureCleanup) Source #

A helper for specifying no cleanup.

withCleanup :: a -> IO () -> (a, FixtureCleanup) Source #

A helper for defining the cleanup function in-line.

cleanupFixtures :: FixtureScopeKey -> IO () Source #

Clean up fixtures in the given scope.

Clean up functions are run in the reverse order the fixtures finished in. For example, if a test asks for fixtures A and C, A asks for B, and C asks for D, the fixtures should finish loading in order: B, A, D, C. Cleanup should then go in order: C, D, A, B.

Built-in fixtures

newtype FixtureSkeletestTmpDir Source #

A fixture that provides a global temporary directory for internal Skeletest use.

newtype FixtureTmpDir Source #

A fixture that provides a temporary directory that can be used in a test.

Constructors

FixtureTmpDir FilePath