Hi Miguel,

On Wed, Sep 9, 2015 at 5:23 AM, Miguel Di Ciurcio Filho <
[email protected]> wrote:

> Hi there,
>
> I was playing with rspec and run `rake spec` on puppetlabs-apache module.
>
> I'm have puppet-agent 1.2.2 installed and this error happens:
>
> Failure/Error: Unable to find matching line from backtrace
>      NameError:
>        uninitialized constant Facter::Util::Loader
>
> After some investigation, I've found that the problem comes down to
> theses lines:
>
>
> https://github.com/puppetlabs/puppetlabs-apache/blob/master/spec/spec_helper.rb#L9
>
> Facter::Util::Loader.any_instance.stubs(:load_all)
>

Facter 3 doesn't have a Facter::Util::Loader defined, which is why this
code is unable to stub it.  Removing this line should be fine.


> Facter.clear
>

This call to `Facter.clear` should remain as it is attempting to ensure
that the facts collection is cleared between test runs.


> Facter.clear_messages
>

This method was removed in Facter 2, so I'm unsure as to how this was
working without testing against Facter 1.x.  Regardless, it should also be
removed.


> Looking further into the problem, I looked into the logs produced by
> Travis-CI and finally understood that the tests are depending on
> Facter 2.
>
> I commented out those 3 lines and the tests passed fine locally.
>
> Since I'm not that familiar with Facter's API changes from 2 to 3, are
> these 3 lines still relevant? I've read the comment above them (Ensure
> that we don't accidentally cache facts and environment between test
> cases) but I still don't understand what is the issue being handled.
>
> Is this in any way related to
> https://tickets.puppetlabs.com/browse/FACT-981 ?
>
> Regards,
>
> Miguel
>
>
> --
> http://www.instruct.com.br - 19 2511-6506
>
> --
> 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/CAK6Ystn5GJNNQyaoqEwCVj3VbVYgQ3tDOGkzx5c1REgPyJnkgA%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
--
Peter Huene
Software Engineer, Puppet Labs
Puppet Open Source Team
-------------------------------------------

PuppetConf 2015 is coming to Portland, Oregon! Join us October 5-9!

-- 
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/CACZQQfNZt4UhePqNekpJ9MEdAFg8iK0jebAE1hfhbbDDA6ZBBw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to