Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Test :: Effect where
- testDir :: forall r. Member Test r => Sem r (Path Abs Dir)
- tempDir :: forall r. Member Test r => Path Rel Dir -> Sem r (Path Abs Dir)
- tempFile :: forall r. Member Test r => [Text] -> Path Rel File -> Sem r (Path Abs File)
- tempFileContent :: forall r. Member Test r => Path Rel File -> Sem r Text
- fixturePath :: forall p r. Member Test r => Path Rel p -> Sem r (Path Abs p)
- fixture :: forall r. Member Test r => Path Rel File -> Sem r Text
Documentation
data Test :: Effect where Source #
Operations for interacting with fixtures and temp files in a test.
TestDir :: Test m (Path Abs Dir) | |
TempDir :: Path Rel Dir -> Test m (Path Abs Dir) | |
TempFile :: [Text] -> Path Rel File -> Test m (Path Abs File) | |
TempFileContent :: Path Rel File -> Test m Text | |
FixturePath :: Path Rel p -> Test m (Path Abs p) | |
Fixture :: Path Rel File -> Test m Text |
Instances
type DefiningModule Test Source # | |
Defined in Polysemy.Test.Data.Test type DefiningModule Test = "Polysemy.Test.Data.Test" |
testDir :: forall r. Member Test r => Sem r (Path Abs Dir) Source #
Return the base dir in which tests are executed.
tempDir :: forall r. Member Test r => Path Rel Dir -> Sem r (Path Abs Dir) Source #
Create a subdirectory of the directory for temporary files and return its absolute path.
tempFile :: forall r. Member Test r => [Text] -> Path Rel File -> Sem r (Path Abs File) Source #
Write the specified lines of Text
to a file under the temp dir and return its absolute path.
tempFileContent :: forall r. Member Test r => Path Rel File -> Sem r Text Source #
Read the contents of a temporary file.
fixturePath :: forall p r. Member Test r => Path Rel p -> Sem r (Path Abs p) Source #
Construct a path relative to the fixture directory.