Safe Haskell | None |
---|---|
Language | Haskell98 |
- module Control.Lens
- module Data.Monoid
- module Puppet.PP
- module Puppet.Interpreter.Types
- module Puppet.Lens
- hspec :: Spec -> IO ()
- basicTest :: PSpec
- usersGroupsDefined :: PSpec
- testingDaemon :: PuppetDBAPI IO -> FilePath -> (Text -> IO Facts) -> IO (Text -> IO (Either PrettyError (FinalCatalog, EdgeMap, FinalCatalog, [Resource])))
- defaultDaemon :: FilePath -> IO (Text -> IO (Either PrettyError (FinalCatalog, EdgeMap, FinalCatalog, [Resource])))
- testCatalog :: Nodename -> FilePath -> FinalCatalog -> PSpec -> IO Summary
- describeCatalog :: Nodename -> FilePath -> FinalCatalog -> PSpec -> Spec
- it :: Example a => String -> PSpecM a -> PSpec
- shouldBe :: (Show a, Eq a) => a -> a -> PSpecM Expectation
- type PSpec = PSpecM ()
- type PSpecM = ReaderT TestEnv SpecM
- lCatalog :: HasTestEnv c => Lens' c FinalCatalog
- lModuledir :: HasTestEnv c => Lens' c FilePath
- lPuppetdir :: HasTestEnv c => Lens' c FilePath
- withResource :: String -> Text -> Text -> (Resource -> Expectation) -> PSpec
- withParameter :: Text -> Resource -> (PValue -> Expectation) -> Expectation
- withParameters :: [(Text, PValue)] -> Resource -> Expectation
- withFileContent :: String -> Text -> (Text -> Expectation) -> PSpec
Documentation
module Control.Lens
module Data.Monoid
module Puppet.PP
module Puppet.Interpreter.Types
module Puppet.Lens
Run given spec and write a report to stdout
.
Exit with exitFailure
if at least one spec item fails.
usersGroupsDefined :: PSpec Source
This tests that all users and groups used as resource parameters are defined
:: PuppetDBAPI IO | Contains the puppetdb API functions |
-> FilePath | Path to the manifests |
-> (Text -> IO Facts) | The facter function |
-> IO (Text -> IO (Either PrettyError (FinalCatalog, EdgeMap, FinalCatalog, [Resource]))) |
Initializes a daemon made for running tests, using the specific test puppetDB
defaultDaemon :: FilePath -> IO (Text -> IO (Either PrettyError (FinalCatalog, EdgeMap, FinalCatalog, [Resource]))) Source
A default testing daemon.
testCatalog :: Nodename -> FilePath -> FinalCatalog -> PSpec -> IO Summary Source
describeCatalog :: Nodename -> FilePath -> FinalCatalog -> PSpec -> Spec Source
lCatalog :: HasTestEnv c => Lens' c FinalCatalog Source
lModuledir :: HasTestEnv c => Lens' c FilePath Source
lPuppetdir :: HasTestEnv c => Lens' c FilePath Source
:: String | The test description (the thing that goes after should) |
-> Text | Resource type |
-> Text | Resource name |
-> (Resource -> Expectation) | Testing function |
-> PSpec |
Run tests on a specific resource
:: Text | The parameter name |
-> Resource | The resource to test |
-> (PValue -> Expectation) | Testing function |
-> Expectation |
Tests a specific parameter
:: [(Text, PValue)] | The parameter names and values |
-> Resource | The resource to test |
-> Expectation |
Test a serie of parameters
:: String | Test description (the thing that goes after should) |
-> Text | The file path |
-> (Text -> Expectation) | Testing function |
-> PSpec |
Retrieves a given file content, and runs a test on it. It works on the explicit "content" parameter, or can resolve the "source" parameter to open the file.