[Puppet Users] rspec-puppet failures when calling none standard types

Danny Roberts
Fri, 21 Nov 2014 19:15:30 -0000

I am working on adding testing to a module I write
(https://github.com/kemra102/puppet-zabbix).

I am currently writing the tests for the 'zabbix::repo' class and I am
getting the following error:

  1) zabbix on ubuntu systems
     Failure/Error: it { should contain_apt__source('ubuntu-zabbix') }
     Puppet::Error:
       Ubuntu  is not supported by this module. at
/home/kemra102/projects/puppet-zabbix/spec/fixtures/modules/zabbix/manifests/params.pp:143
on node iacon.cybertron.local
     # ./spec/classes/zabbix_repo_spec.rb:16:in `block (3 levels) in <top
(required)>'

Here is the test:

require 'spec_helper'

describe 'zabbix', :type => :class do
  it { should contain_class('zabbix::repo') }

  context 'on redhat family systems' do
    let (:facts) { { :osfamily => 'RedHat' } }

    it { should contain_yumrepo('zabbix') }
    it { should contain_yumrepo('zabbix-non-supported') }
  end

  context 'on ubuntu systems' do
    let (:facts) { { :osfamily => 'Debian', :operatingsystem =>
'Ubuntu' } }

    it { should contain_apt__source('ubuntu-zabbix') }
  end

end

I find it strange that the apt::source test for Ubuntu is failing given
that the yumrepo ones pass absolutely without error. I can give the missing
'::operatingsystemmajrelease' it is looking for but then it just asks
for
other variables in a seemingly never ending list.

Any ideas why only the apt repo is failing?

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/ef715a15-713f-43dd-a42f-aebbd333c99e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.