2012-01-23 22:08:00 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
describe 'apt::params', :type => :class do
|
2015-04-27 20:31:39 +02:00
|
|
|
let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy', :puppetversion => '3.5.0', } }
|
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-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
|
2015-04-27 20:31:39 +02:00
|
|
|
let(:facts) { { :osfamily => 'Debian', :puppetversion => '3.5.0', } }
|
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
|
|
|
|
|
2015-04-27 20:31:39 +02:00
|
|
|
describe "With old puppet version" do
|
|
|
|
let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy', :lsbdistrelease => 'foo', :lsbdistdescription => 'bar', :lsbminordistrelease => 'baz', :lsbmajdistrelease => 'foobar', :puppetversion => '3.4.0', } }
|
|
|
|
let(:title) { 'my_package' }
|
|
|
|
it { is_expected.to contain_apt__params }
|
|
|
|
|
|
|
|
# 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
|
|
|
|
expect(subject.call.resources.size).to eq(4)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-01-23 22:08:00 +01:00
|
|
|
end
|