Age | Commit message (Collapse) | Author |
|
|
|
|
|
Prior to this commit, if a hash was passed in as an
argument to the ensure_packages function a method of
hash duplication would be used that is not supported
with versions of ruby older than 2.0. In order to
ensure the method is compatible with older ruby versions,
switch to a different method of duplication.
Additionally add tests to prevent further regressions.
|
|
Tests in the new style produces the following documentation output:
abs
should not eq nil
should run abs() and raise an Puppet::ParseError
should run abs(-34) and return 34
should run abs("-34") and return 34
should run abs(34) and return 34
should run abs("34") and return 34
|
|
rspec-puppet matchers are defined for tests which exist in
spec/functions, but the function unit tests lived in
spec/unit/puppet/parser/functions. This moves them to the correct place
for using rspec-puppet
|
|
|
|
Without this patch one can not specify package resource specific
parameters. All the ensure_packages() function does it makes sure
the named packages are installed. This patch allows one to pass
default as a second argument and allow greater flexibility on
packages installations.
Use case like the following are now possible :
* ensure_packages(['r10k', 'serverspec'], {'provider' => 'gem'})
* ensure_packages(['ntp'], {'require' => 'Exec[foobar]'})
|
|
This work updates a number of Gems to the latest versions (rspec,
rspec-puppet), and updates and tweaks a bunch of tests to work
with the updated gems.
|
|
The previous behavior of the tests checked the behavior of the
underlying functions library when called with no arguments; this commit
updates the tests to conform to the functions API and test what happens
when a function is called with no args.
|
|
|
|
Without this patch the stdlib spec tests are failing against recent
versions of Puppet. The root cause of this problem is a change in the
behavior of create_resources in Puppet 6baa57b. The change in behavior
caused the :name key to be omitted from the hash returned by
Puppet::Parser::Resource#to_hash which in turn is causing the test
failure.
This patch addresses the problem by updating the test to match the
description of the example. Only the attribute :ensure is checked
instead of the full hash itself.
|
|
Without this patch the ensure_packages() function has no rspec behavior
examples. This patch fixes the problem by filling out a spec file with
expected behaviors I could think of.
|