- Initialise Hiera 3 before loading any monkey patches to ensure that the
correct code is loaded for the actual platform running the tests.
- Performance regression with Puppet < 4.0.0 due to overly agressive cache
- Clarified rspec-puppet-init output when run inside a directory that does not
- An issue where the optional minimum resource coverage check would throw an
exception when the coverage wasn’t 100%.
- Fixed an issue caused by
Puppet::Util.get_env when pretending to be a
derive_node_facts_from_nodename setting added to disable the overriding of
domain facts with values derived from the node
name specified with
trusted_facts hash now accepts symbol keys, matching the behaviour of
- The modifications made to Puppet internals are now contained to rspec-puppet
examples, preventing them from bleeding out into other examples in the same
RSpec process (like Ruby unit tests).
- rspec-puppet no longer attempts to configure settings for Puppet 3.x
releases that they do not support.
- A regression that prevented environment names to be specified as a symbol.
- A regression that prevented the
environmentpath setting from taking
- Stubbed out the automatic confines created by resource providers on their
specified commands, which was preventing the correct provider from being
assigned to a resource when performing cross-platform testing.
- Facts derived from the node name now only get merged on top of the facts
let(:facts) if the
node name has been manually specified with
- Puppet 5.0.x added to the CI test matrices.
- The automatic setup code now checks for the presence of
the working directory. If not present, it assumes that rspec-puppet is
running from inside a control repo instead of a module and skips creating
spec/fixtures directory structure and link.
- A new configuration option has been added
RSpec.configuration.setup_fixtures) that controls whether rspec-puppet
will manage the
- A race condition when running rspec-puppet under parallel_tests causing
errors when creating the
- The contents of the
networking fact hash is no longer cleared when merging
in the facts derived from the node name.
- 2.6.0 introduced a change to how resource titles are rendered in the test
manifest which caused them to get rendered as double quoted strings. This
caused a failure for tests of defined types that contained
as Puppet would try and interpolate the values in the title as variable(s).
The Windows parity release. rspec-puppet now officially supports Windows. A lot
of work has been put in to support cross-platform tests, so that you can now
test your Windows manifests on *nix, and your *nix manifests on Windows.
- Puppet settings are now applied as application overrides, allowing users to
Puppet.settings directly to make changes to settings without them
getting clobbered by rspec-puppet.
- Improved support for setting up the
spec/fixtures/modules link on Windows
by using directory junctions instead of symlinks, removing the need for
- When testing for the absence of a parameter on a resource, the error message
now contains the value(s) of the parameter(s) that should be undefined.
- When testing a defined type, the defined type being tested is no longer part
of the coverage report.
- The cached catalogue will now be invalidated when hiera-puppet-helper users
- Multiple instances of a defined type can now be tested at once by providing
an array of strings with
- Explicitly specifying the type of an example group (
:type => :class) now
takes precedence over the type inferred from the spec file’s location.
- The manifest specified in
RSpec.configuration.manifest (path to
for Puppet < 4.x) is now imported if specified on Puppet >= 4.x.
- Puppet functions called when testing a Puppet function now get executed in
the same scope as parent function.
- The module is now automatically linked into
spec/fixtures/modules at the
start of the rspec-puppet run.
- CI testing of PRs on Windows via Appveyor.
- Support for setting node parameters (mocking the behaviour of an ENC or
Puppet Enterprise Console) using
- Support for injecting Puppet code at the end of the test code using
- Resource coverage reports for
- Puppet functions that take a lambda as a parameter can now be tested by
with_lambda to the
- Facts and trusted facts are now available when testing Puppet functions.
- Hiera configuration can now be specified when testing Puppet functions using
- Trusted facts (
$trusted) can now be specified in
RSpec.configuration.default_trusted_facts or by
:default is now a supported parameter value when passed in by
- Support for testing Puppet data type aliases.
- Facts generated from the node name (as set by
let(:node)) now take
precedence over the values specified in
- Only fact names will now be converted to lowercase, not the fact values.
- Matchers now support resources where the namevar has a different value to
- Resources created outside of the module being tested by functions like
ensure_package are no longer present in the coverage
report from Puppet 4.6 onwards.
- Guards have been put in place to prevent the possibility of rspec-puppet
getting stuck in an infinite recursion when testing the relationships
- A full
spec/spec_helper.rb file is now written out by
to fix the
fixture_path issue on new modules.
- The namevar of a resources is no longer taken into account when testing the
exact parameters of the resource with
- Minimum resource coverage check for RSpec <= 3.2.
- Resource parameters that take a hash as their value will no longer have that
hash converted into an array.
- Testing the value of a parameter with a Proc that returns
nil now works as
- When testing Puppet functions, the function name is no longer automatically
coverted to lowercase.
- The value of
$::environment is now forced to be a string as expected for
Puppet 4.0 - 4.3.
- app_management is no longer enabled by rspec-puppet for Puppet >= 5.0 as it
is already enabled by default.
- Failing to provide parameters when testing an application now raises the
correct exception (
- Ruby symbols in nested hashes or arrays are now converted into strings when
passed in by
- Namespaced resources are now correctly capitalised when being added to the
resource coverage filter.
Headline features are app management, nested hashes in params, and testing for
Thanks to everyone who contributed: Leo Arnold, Matt Schuchard, and Si Wilkins.
- Updates to the README
- Improved Gemfile to work with older versions of Ruby
- Added support for app management testing
- Added support for nested hashes in params
- Added support for testing Puppet 4.x “internal” functions
- Link functions and types into test dir on setup
- Increased test coverage
This release now supports testing exported resources in the same way that
normal resources in the catalogue are tested. Access them in your examples
exported_resources. See “Testing Exported Resources” in the README for
Thanks to Adrien Thebo, Arthur Gautier, Brett Gray and Nicholas Hinds, as well
as all the folks helping out on github for the contributions to this release.
- Pulled a lot of the version specific code into separate classes to reduce
complexity and enable easier maintenance going forward.
- Added support for colon separated module_path and environmentpath values
- Added support for setting a minimum threshold for the code coverage test
- Added code to reinitialise Puppet before each example in order to ensure
a consistent test environment.
Properly fix yesterday’s issue by unsharing the cache key before passing the
data to Puppet. This also contains a new test matrix to avoid missing
a half-baked fix.
A quick workaround to re-enable testing with the recently released Puppet 3.8.5
and the soon to be released Puppet 4.3.2. See PUP-5743 for the gritty details.
Upgrade to this version if you hit the “undefined method `resource’ for
rspec-puppet now supports testing custom types,
:undef values in params,
structured facts, and checks resource dependencies recursively.
The settings in
manifest are now respected throughout the
code base. The former default for
dropped to avoid accidentally poisoning the test environment with unrelated
To reduce the maintenance overhead of boilerplate code, rspec-puppet now
provides some of the code that rspec-puppet-init deployed in helper files that
you can just
This release also reduces memory usage on bigger testsuites drastically by
reducing the caching of compiled catalogues.
Thanks to Adrien Thebo, Alex Harvey, Brian, Dan Bode, Dominic Cleal, Javier
Palacios, Jeff McCune, Jordan Moldow, Peter van Zetten, Raphael Pinson, Simon
Kohlmeyer, and Tristan Colgate for their contibutions to this release.
- Limit the catalogue cache to 16 entries. Significant memory savings and
reduced runtime were observed in testing this.
- Prevent Puppet 3.x _timestamp fact from invalidating the cache.
- Extracted catalogue cache from RSpec::Puppet::Support.
- Updates README to use the rspec 3 expect syntax, and additional
contain_file(...).with_content(...) will now only show the diff and not
the full contents of the file.
- Custom type testing example group and matcher
- before/require/subscribe/notify checking now searches recursively through
File[a] -> File[b] -> File[c] is now matched by
contain_file('a').that_comes_before('File[c]'), whereas earlier versions
would have missed that.
- Support structured facts with keys as symbols or strings
- rspec-puppet-init now creates smaller files, using rspec-puppet helpers,
instead of pasting code into the module.
- Added a list of related projects to the README.
compile.and_raise_error now correctly considers successful compilation an
module_path can now contain multiple entries and rspec-puppet
will configure Puppet to load code from all of them.
- Support running with rspec 2.99 again
- Non-class resources are now covered by the coverage code
- Autorequires checking doesn’t abort on “undefined method `’ for
- Improved documentation for hiera integration, added example spec
- Document the
- Added setting for ordering, strict_variables, stringify_facts, and
- Exposed the scope in function example groups.
- rspec-puppet-init now works with Puppet 4
- Several fixes and enhancements for the
- Recompile the catalogue when the hiera config changes
- Puppet 4 support
- Ability to set
environment with a let block
- Better function failure messages
- Filter fixtures out of coverage reports
- Fix functions accidentally modifying rspec function arguments
- Restructured TravisCI matrix (NB: Puppet 2.6 is no longer tested)
- Allow RSpec 2 to still be used
subject is now a lambda to enable catching of compilation failures.
- Ability to use RSpec 3
- Hiera integration
- Coverage reports
- Ability to test on the future parser
- Function tests now have access to the catalogue
- Add array of references support to the relationship matchers
- Better error messages and handling for parameters (
nil and friends) and
- Fixed bug where under certain circumstances a newline isn’t added after the
pre_condition, causing the catalogue compilation to fail.
- When comparing parameter values, munge the actual value into an array if the
expected value is an array with a single item.
- Added support for setting
confdir inside the
- Added support for checking if all the dependencies in the graph have been met
- Added support for passing values to
- Added matcher to count the number of resources in the catalogue of
a particular type
- Function matcher now checks if the specified error has been thrown
only_with chain to the
contain_* matchers to check if the resource
only has the specified parameters.
- Manifest matchers (
contain_*, etc.) are now available when testing
- Added support for passing Procs to
.and_return(false) when testing functions
- Removed the deprecated
compile matcher to check if the manifest compiles without any
- Improved the Rakefile generated by
- Fixed bug where RSpec fails when passed nil pre_condition
- Added heira support
- Removed the dependency on puppetlabs_spec_helper
- Added implementation agnostic relationship matchers
- Puppet 3.2.x support
- Puppet 3.3.x support
- Improved matching of parameter values, now supports complex data types
- Fixed bug where RSpec fails when testing a define without specifying
include_class matcher in favour of
- Allow an array of pre_conditions
object name is a symbol error when a test on a function fails
- Puppet 3.1.x support
- Improved catalogue caching for faster testing on the same compiled catalogue
- Add support for pre_condition when testing functions
- Fix bug when specifying a array with a single value as a parameter
- Add support for testing the catalogue of a node
- Add Puppet[:config] as a supported option
- Add rspec-puppet-init helper script
- Chained methods added to description of contain_* matcher
- Add support for Ruby 1.9.x
- Add ‘with’ and ‘without’ chains to the ‘contain_’ matcher to support
testing multiple parameters by supplying a Hash.
- Add support for passing regular expressions to ‘with_’ and ‘without_’
- Add support for testing Puppet functions
- Add support for setting custom ‘manifestdir’, ‘manifest’ and ‘templatedir’
Puppet config values
- Provide a default ‘domain’ fact
- Add support for fact names as Symbols
- Add ‘without_*’ chain to the ‘contain_*’ matcher to test for the absence
- Remove Faces API call for Puppet 2.7.x
- Remove quotes from resource references
- Fix 0.0.4 release (incorrect tag pushed for 0.0.4 release)
- DRY up catalogue compilation
- Add support for ‘pre_condition’ to allow the specification of external
dependencies for classes and defines
- Provide default ‘hostname’ and ‘fqdn’ facts
- Change generic resource matcher to support ‘contain_’ as well as ‘create_’
- Support ‘__’ for resources/classes that contain ‘::’