On 8/14/14 3:56 PM, Sebastian Otaegui wrote:
> I created a small POC module using puppet from master and `puppet module
> generate`
> 
> I still have rspec-puppet go inside the apt module in fixtures and
> execute the tests:
> 
> Failures:
> 
>   1) poc with defaults for all parameters should contain Class[poc]
>      Failure/Error: it { should contain_class('poc') }
>      Puppet::Error:
>        This module only works on Debian or derivatives like Ubuntu at
> /Users/otaeguis/projects/src/test-poc/spec/fixtures/modules/apt/manifests/init.pp:43
> on node feniixhq.10.208.50.91
>      # ./spec/classes/init_spec.rb:5:in `block (3 levels) in <top
> (required)>'
> 
> Here is a link to the puppet module with the
> POC https://github.com/feniix/puppet-module-rspec-issue
> 
> Appreciate some guidance on how to solve this.
> 
> 
> 
> On Wed, Aug 13, 2014 at 10:30 PM, Garrett Honeycutt
> <[email protected] <mailto:[email protected]>> wrote:
> 
>     On 8/13/14 9:08 PM, Wil Cooley wrote:
>     >
>     > On Aug 12, 2014 11:57 AM, "Sebastian Otaegui" <[email protected]
>     <mailto:[email protected]>
>     > <mailto:[email protected] <mailto:[email protected]>>> wrote:
>     >>
>     >> Hello all,
>     >>
>     >> I have created this module:
>     >>
>     >> https://github.com/Spantree/puppet-thrift and everything worked fine
>     > all specs ran fine.
>     >>
>     >> Now I using the puppetlabs/apt module and when I run the 'rake spec'
>     > it is trying to run the 'apt' tests, and it is failing (I think)
>     because
>     > I am not providing the appropriate facts.
>     >>
>     >> Is there a way to ignore the rspecs inside the fixtures/modules/
>     > directory?
>     >>
>     >> I tried to do this:
>     >>
>     >> require 'rake'
>     >> require 'rspec/core/rake_task'
>     >>
>     >> RSpec::Core::RakeTask.new(:spec) do |t|
>     >>   t.pattern = 'spec/*/*_spec.rb'
>     >> end
>     >>
>     >> But it didn't work.
>     >>
>     >
>     > How about just:
>     >
>     > require 'puppetlabs_spec_helper/rake_tasks'
> 
>     Hi,
> 
>     +1 to Will Cooley.
> 
>     When you generate a module with `puppet module generate` it will use
>     that single line.
> 
>     
> https://github.com/puppetlabs/puppet/blob/master/lib/puppet/module_tool/skeleton/templates/generator/spec/spec_helper.rb
> 
>     Best regards,
>     -g
> 
>     --
>     Garrett Honeycutt
>     @learnpuppet
>     Puppet Training with LearnPuppet.com
>     Mobile: +1.206.414.8658 <tel:%2B1.206.414.8658>
> 

Hi Sebastian,

Your issue is because the module in question is failing if certain facts
are not set. In puppetlabs/apt the module fails[1] if $osfamily is not
'Debian'. For your spec tests to succeed you need to set the osfamily
fact to Debian.

[1] -
https://github.com/puppetlabs/puppetlabs-apt/blob/master/manifests/init.pp#L43-45

Best regards,
-g

-- 
Garrett Honeycutt
@learnpuppet
Puppet Training with LearnPuppet.com
Mobile: +1.206.414.8658

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/53ED1BA9.6090107%40garretthoneycutt.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to