A bit late to the party here, but in my (rspec-puppet) tests I have created
a mock version of the function in a before(:each) block in the unit test
for the class, like this:

  before(:each) do
    Puppet::Parser::Functions.newfunction(:query_nodes, :type => :rvalue) {
|_| ["foo.example.com", "bar.example.com"] }
  end



On Mon, 19 Dec 2016 at 18:23 Jordan Conway <jor...@jordanconway.com> wrote:

> I was running into the same issue with that module, and I found that
> including the puppetdb mock class from the source module helped.
> It may be more involved, but at first glance, this helps me quiet a bunch
> of the errors to get down to spec testing my actual module.
>
>
> https://raw.githubusercontent.com/dalen/puppet-puppetdbquery/master/spec/puppet/util/puppetdb.rb
>
> Cheers,
> Jordan
>
>
> On Tuesday, November 1, 2016 at 6:13:03 PM UTC-4, Salty Old Cowdawg wrote:
>
> Garret:  I do have dalen-puppetdb in my .fixtures.yaml file.   A link to
> my project?  unfortunately I'm developing all this work inside my client's
> cloud and can't provide a link.
>
> On Tue, Nov 1, 2016 at 6:11 PM Peter Berghold <salty....@gmail.com> wrote:
>
> That's what I was beginning to suspect Andy.  Now I have to go find the
> Ubuntu version of that....
>
> On Tue, Nov 1, 2016 at 5:38 PM Andrew Grimberg <tyk...@bardicgrove.org>
> wrote:
>
> On 11/01/2016 02:25 PM, Garrett Honeycutt wrote:
> > On 11/1/16 4:03 PM, Peter Berghold wrote:
> >> I have a module that I am writing spec tests for that uses the Puppet
> >> Forge module cited in the subject line to query for a list of nodes
> >> fitting a particular criteria.  When I run the spec test it bombs out
> >> with a message: "cannot load such file -- puppet/util/puppetdb"
> >>
> >> After a bit of searching I am still left wondering package or gem this
> >> is looking for.  Anybody know?
> >>
> >
> > Hi,
> >
> > Do you have dalen/puppet-puppetdbquery in your .fixtures.yml? A link to
> > your project would make debugging easier.
>
> It's probably related to the fact that dalen-puppetdbquery requires
> PuppetDB Terminus installed. Not certain how you get around that for
> spec tests.
>
> -Andy-
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users...@googlegroups.com.
>
>
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/ea142093-9c29-2fe2-8202-0ae09709ef21%40bardicgrove.org
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/58d955c3-1c4d-4e37-b29b-d952f0e64775%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/58d955c3-1c4d-4e37-b29b-d952f0e64775%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAAAzDLfhHUWsU5ScFFB_9KCzNBo49L2XyaRsvrC_Uw67gAKFmw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to