params_spec.rb 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. require 'spec_helper'
  2. describe 'apt::params', :type => :class do
  3. let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian' } }
  4. let (:title) { 'my_package' }
  5. it { should contain_apt__params }
  6. # There are 4 resources in this class currently
  7. # there should not be any more resources because it is a params class
  8. # The resources are class[apt::params], class[main], class[settings], stage[main]
  9. it "Should not contain any resources" do
  10. subject.resources.size.should == 4
  11. end
  12. describe "With unknown lsbdistid" do
  13. let(:facts) { { :lsbdistid => 'CentOS', :osfamily => 'Debian' } }
  14. let (:title) { 'my_package' }
  15. it do
  16. expect {
  17. should compile
  18. }.to raise_error(Puppet::Error, /Unsupported lsbdistid/)
  19. end
  20. end
  21. describe "With lsb-release not installed" do
  22. let(:facts) { { :lsbdistid => '', :osfamily => 'Debian' } }
  23. let (:title) { 'my_package' }
  24. it do
  25. expect {
  26. should compile
  27. }.to raise_error(Puppet::Error, /Unable to determine lsbdistid, is lsb-release installed/)
  28. end
  29. end
  30. end