2012-01-23 22:08:00 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
describe 'apt::params', :type => :class do
|
2014-03-07 16:03:44 +01:00
|
|
|
let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian' } }
|
2012-01-23 22:08:00 +01:00
|
|
|
let (:title) { 'my_package' }
|
|
|
|
|
2015-02-24 22:20:29 +01:00
|
|
|
it { is_expected.to contain_apt__params }
|
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-02-24 22:20:29 +01:00
|
|
|
expect(subject.resources.size).to eq(4)
|
2012-01-23 22:08:00 +01:00
|
|
|
end
|
2014-02-27 10:23:11 +01:00
|
|
|
|
|
|
|
describe "With unknown lsbdistid" do
|
|
|
|
|
2015-02-15 18:39:17 +01:00
|
|
|
let(:facts) { { :lsbdistid => 'CentOS', :osfamily => 'Debian' } }
|
2014-02-27 10:23:11 +01:00
|
|
|
let (:title) { 'my_package' }
|
|
|
|
|
|
|
|
it do
|
|
|
|
expect {
|
2015-02-24 22:20:29 +01:00
|
|
|
is_expected.to compile
|
2014-02-27 10:23:11 +01:00
|
|
|
}.to raise_error(Puppet::Error, /Unsupported lsbdistid/)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2014-07-10 19:48:54 +02:00
|
|
|
|
|
|
|
describe "With lsb-release not installed" do
|
2015-02-15 18:39:17 +01:00
|
|
|
let(:facts) { { :lsbdistid => '', :osfamily => 'Debian' } }
|
2014-07-10 19:48:54 +02:00
|
|
|
let (:title) { 'my_package' }
|
|
|
|
|
|
|
|
it do
|
|
|
|
expect {
|
2015-02-24 22:20:29 +01:00
|
|
|
is_expected.to compile
|
2014-07-10 19:48:54 +02:00
|
|
|
}.to raise_error(Puppet::Error, /Unable to determine lsbdistid, is lsb-release installed/)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-01-23 22:08:00 +01:00
|
|
|
end
|