Hi, On Tuesday, April 28, 2015 at 3:54:09 PM UTC+1, henrik lindberg wrote: > > On 2015-28-04 15:16, Erik Dalén wrote: > > Do any of you have any tips in regards to unit testing function using > > the v4 API in modules? > > > > I would like to do something like this: > > > https://github.com/puppetlabs/puppet/blob/master/spec/unit/functions/scanf_spec.rb > > > > > But PuppetSpec::Compiler & Matchers::Resource are in the spec/lib > > directory of puppet which I can't depend on from a module AFAIK. > > > > Is there something equivalent in puppetlabs_spec_helper that works for > > v4 API functions? > > > There is an updated version of puppet-rspec that will help with this. (I > heard about this yesterday). Hunner knows more. >
rspec-puppet 2.1.0 should have all that work. There are a few more patches and bug fixes in the pipeline, but 2.1.0 should already get you far. Some examples of rspec-puppet only function testing can be found in the upcoming refresh of stdlib's function specs, currently in my WIP branch here: https://github.com/DavidS/puppetlabs-stdlib/commits/modules-1882-rspec-puppet-migration Regards, David -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/0244e11a-530f-4e84-ae50-34d4be7c593a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
