Re: [Puppet-dev] Re: Unit testing v4 functions in modules

2015-05-21 Thread Erik Dalén
Thanks a lot for looking into it and solving it. I'm traveling a bit ATM, but will give it a try once I'm back. On Wed, May 13, 2015, 12:36 David Schmitt wrote: > Hi Erik, *! > > > >> > Is there something equivalent in puppetlabs_spec_helper that works for > v4 API functions? > Th

Re: [Puppet-dev] Re: Unit testing v4 functions in modules

2015-05-13 Thread David Schmitt
Hi Erik, *! > > 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

Re: [Puppet-dev] Re: Unit testing v4 functions in modules

2015-05-11 Thread David Schmitt
On Friday, May 8, 2015 at 12:19:51 PM UTC+1, Erik Dalén wrote: > > > > On Thu, 7 May 2015 at 13:16 David Schmitt > wrote: > >> 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

Re: [Puppet-dev] Re: Unit testing v4 functions in modules

2015-05-08 Thread Erik Dalén
On Thu, 7 May 2015 at 13:16 David Schmitt wrote: > 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

[Puppet-dev] Re: Unit testing v4 functions in modules

2015-05-07 Thread David Schmitt
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/

Re: [Puppet-dev] Re: Unit testing v4 functions in modules

2015-05-04 Thread Erik Dalén
On Thu, 30 Apr 2015 at 18:10 Joshua Hoblitt wrote: > The core v4 function unit tests appear to be using Puppet::Pops::Loaders > to find the function method. E.g. > > Puppet.lookup(:loaders).puppet_system_loader.load(:function, > 'regsubst').call({}, *args) > > From: > > > https://github.com/

Re: [Puppet-dev] Re: Unit testing v4 functions in modules

2015-05-04 Thread Erik Dalén
On Fri, 1 May 2015 at 00:55 Henrik Lindberg wrote: > On 2015-30-04 18:10, Joshua Hoblitt wrote: > > The core v4 function unit tests appear to be using Puppet::Pops::Loaders > > to find the function method. E.g. > > > > Puppet.lookup(:loaders).puppet_system_loader.load(:function, > > 'regsub

[Puppet-dev] Re: Unit testing v4 functions in modules

2015-04-30 Thread Henrik Lindberg
On 2015-30-04 18:10, Joshua Hoblitt wrote: The core v4 function unit tests appear to be using Puppet::Pops::Loaders to find the function method. E.g. Puppet.lookup(:loaders).puppet_system_loader.load(:function, 'regsubst').call({}, *args) From: https://github.com/puppetlabs/puppet/blob/m

Re: [Puppet-dev] Re: Unit testing v4 functions in modules

2015-04-30 Thread Joshua Hoblitt
The core v4 function unit tests appear to be using Puppet::Pops::Loaders to find the function method. E.g. Puppet.lookup(:loaders).puppet_system_loader.load(:function, 'regsubst').call({}, *args) From: https://github.com/puppetlabs/puppet/blob/master/spec/unit/functions/regsubst_spec.rb -J

Re: [Puppet-dev] Re: Unit testing v4 functions in modules

2015-04-30 Thread Erik Dalén
I'm not even getting the custom functions to load if I set $RUBYLIB, set libdir or copy them manually to the default libdir (emulating pluginsync). If I build and install this module it works as expected, but at the moment I can't find any good way to test v4 functions without installing them first

Re: [Puppet-dev] Re: Unit testing v4 functions in modules

2015-04-29 Thread Erik Dalén
I'm not getting it to work. Here's a minimal example project with a simple max function: https://github.com/dalen/puppet-v4functiontest And here is the failing travis build for it: https://travis-ci.org/dalen/puppet-v4functiontest/builds/60517933 This is requiring the latest rspec-puppet (2.1.0)

[Puppet-dev] Re: Unit testing v4 functions in modules

2015-04-28 Thread Henrik Lindberg
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::Res

[Puppet-dev] Re: Unit testing v4 functions in modules

2015-04-28 Thread Henrik Lindberg
On 2015-28-04 16:53, 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