language-puppet-0.12.3: Tools to parse and evaluate the Puppet DSL.

Safe HaskellNone

Puppet.Testing

Synopsis

Documentation

module Puppet.PP

hspec :: Spec -> IO ()

Run given spec and write a report to stdout. Exit with exitFailure if at least one spec item fails.

basicTest :: PSpecSource

This tests that file sources are valid.

testingDaemonSource

Arguments

:: PuppetDBAPI IO

Contains the puppetdb API functions

-> FilePath

Path to the manifests

-> (Text -> IO (Container Text))

The facter function

-> IO (Text -> IO (Either Doc (FinalCatalog, EdgeMap, FinalCatalog, [Resource]))) 

Initializes a daemon made for running tests, using the specific test puppetDB

defaultDaemon :: FilePath -> IO (Text -> IO (Either Doc (FinalCatalog, EdgeMap, FinalCatalog, [Resource])))Source

A default testing daemon.

shouldBe :: (Show a, Eq a) => a -> a -> PSpecM ExpectationSource

type PSpecM = ReaderT TestEnv SpecMSource

lCatalog :: HasTestEnv t => Lens' t FinalCatalogSource

lModuledir :: HasTestEnv t => Lens' t FilePathSource

lPuppetdir :: HasTestEnv t => Lens' t FilePathSource

withResourceSource

Arguments

:: 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

withParameterSource

Arguments

:: Text

The parameter name

-> Resource

The resource to test

-> (PValue -> Expectation)

Testing function

-> Expectation 

Tests a specific parameter

withFileContentSource

Arguments

:: 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.