2012-01-23 22:08:00 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
describe 'apt::params', :type => :class do
|
2016-05-24 13:20:33 +02:00
|
|
|
let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy', :puppetversion => Puppet.version, } }
|
2012-01-23 22:08:00 +01:00
|
|
|
|
|
|
|
# There are 4 resources in this class currently
|
|
|
|
# there should not be any more resources because it is a params class
|
|
|
|
# The resources are class[apt::params], class[main], class[settings], stage[main]
|
|
|
|
it "Should not contain any resources" do
|
2015-04-23 01:31:47 +02:00
|
|
|
expect(subject.call.resources.size).to eq(4)
|
2012-01-23 22:08:00 +01:00
|
|
|
end
|
2014-02-27 10:23:11 +01:00
|
|
|
|
2014-07-10 19:48:54 +02:00
|
|
|
describe "With lsb-release not installed" do
|
2016-05-24 13:20:33 +02:00
|
|
|
let(:facts) { { :osfamily => 'Debian', :puppetversion => Puppet.version, } }
|
2014-07-10 19:48:54 +02:00
|
|
|
let (:title) { 'my_package' }
|
|
|
|
|
|
|
|
it do
|
|
|
|
expect {
|
2015-04-23 01:31:47 +02:00
|
|
|
subject.call
|
2015-04-23 22:54:17 +02:00
|
|
|
}.to raise_error(Puppet::Error, /Unable to determine lsbdistid, please install lsb-release first/)
|
2014-07-10 19:48:54 +02:00
|
|
|
end
|
|
|
|
end
|
2012-01-23 22:08:00 +01:00
|
|
|
end
|