module-puppetlabs-apt/spec/classes/params_spec.rb
Morgan Haskel 1139f801eb Convert specs to RSpec 3.1.7 syntax with Transpec
This conversion is done by Transpec 3.0.8 with the following command:
    transpec spec/classes spec/defines spec/unit

* 87 conversions
    from: it { should ... }
      to: it { is_expected.to ... }

* 14 conversions
    from: obj.should
      to: expect(obj).to

* 7 conversions
    from: == expected
      to: eq(expected)

* 1 conversion
    from: it { should_not ... }
      to: it { is_expected.not_to ... }

For more details: https://github.com/yujinakayama/transpec#supported-conversions
2015-02-24 13:20:29 -08:00

39 lines
1.1 KiB
Ruby

require 'spec_helper'
describe 'apt::params', :type => :class do
let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian' } }
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.resources.size).to eq(4)
end
describe "With unknown lsbdistid" do
let(:facts) { { :lsbdistid => 'CentOS', :osfamily => 'Debian' } }
let (:title) { 'my_package' }
it do
expect {
is_expected.to compile
}.to raise_error(Puppet::Error, /Unsupported lsbdistid/)
end
end
describe "With lsb-release not installed" do
let(:facts) { { :lsbdistid => '', :osfamily => 'Debian' } }
let (:title) { 'my_package' }
it do
expect {
is_expected.to compile
}.to raise_error(Puppet::Error, /Unable to determine lsbdistid, is lsb-release installed/)
end
end
end