env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.0"
+ - rvm: 1.9.3
+ env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
+ - rvm: 2.0.0
+ env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
+ - rvm: 1.9.3
+ env: PUPPET_GEM_VERSION="~> 4.0"
+ - rvm: 2.0.0
+ env: PUPPET_GEM_VERSION="~> 4.0"
+ allow_failures:
+ - env: PUPPET_GEM_VERSION="~> 4.0"
+ - env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
notifications:
email: false
group :development, :unit_tests do
gem 'rake', :require => false
gem 'rspec-core', '3.1.7', :require => false
- gem 'rspec-puppet', '~> 1.0', :require => false
+ gem 'rspec-puppet', '~> 2.0', :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint', :require => false
gem 'simplecov', :require => false
end
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error, /If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key/)
end
end
end
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error, /If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key/)
end
end
end
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error, /If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key/)
end
end
end
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error, /If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key/)
end
end
end
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error, /is not a string/)
end
end
end
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error, /is not a string/)
end
end
end
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error, /is not a string/)
end
end
end
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error, /is not a string/)
end
end
end
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error, /pin must be either a string, number or hash/)
end
end
}
end
- it { is_expected.to contain_file('sources.list').without({
- :content => "# Repos managed by puppet.\n",
+ it { is_expected.to contain_file('sources.list').with({
+ :content => nil,
})}
it { is_expected.to contain_file('sources.list.d').with({
let(:params) { { :purge => { 'sources.list' => 'banana' }, } }
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error)
end
end
let(:params) { { :purge => { 'sources.list.d' => 'banana' }, } }
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error)
end
end
let(:params) { { :purge => { 'preferences' => 'banana' }, } }
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error)
end
end
let(:params) { { :purge => { 'preferences.d' => 'banana' }, } }
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error)
end
end
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error, /This module only works on Debian or derivatives like Ubuntu/)
end
end
# 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)
+ expect(subject.call.resources.size).to eq(4)
end
describe "With lsb-release not installed" do
- let(:facts) { { :lsbdistid => '', :osfamily => 'Debian' } }
+ let(:facts) { { :osfamily => 'Debian' } }
let (:title) { 'my_package' }
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error, /Unable to determine lsbdistid, is lsb-release installed/)
end
end
end
it 'fails' do
- expect { subject } .to raise_error(/pass in content/)
+ expect { subject.call } .to raise_error(/pass in content/)
end
end
:server => '-pgp.mit.edu',
} end
it 'fails' do
- expect { subject } .to raise_error(/does not match/)
+ expect { subject.call } .to raise_error(/does not match/)
end
end
:server => '.pgp.mit.edu',
} end
it 'fails' do
- expect { subject } .to raise_error(/does not match/)
+ expect { subject.call } .to raise_error(/does not match/)
end
end
:server => "pgp.mit.edu.",
} end
it 'fails' do
- expect { subject } .to raise_error(/does not match/)
+ expect { subject.call } .to raise_error(/does not match/)
end
end
context "exceed character url" do
}
end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject.call }.to raise_error(/does not match/)
end
end
context "incorrect port number url" do
}
end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject.call }.to raise_error(/does not match/)
end
end
context "incorrect protocol for url" do
}
end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject.call }.to raise_error(/does not match/)
end
end
context "missing port number url" do
}
end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject.call }.to raise_error(/does not match/)
end
end
context "url ending with a dot" do
}
end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject.call }.to raise_error(/does not match/)
end
end
context "url begin with a dash" do
:server => "hkp://-pgp.mit.edu",
} end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject.call }.to raise_error(/does not match/)
end
end
context 'invalid key' do
'Out of rum. Why? Why are we out of rum?'
end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject.call }.to raise_error(/does not match/)
end
end
:source => 'afp://puppetlabs.com/key.gpg',
} end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject.call }.to raise_error(/does not match/)
end
end
:content => [],
} end
it 'fails' do
- expect { subject }.to raise_error(/is not a string/)
+ expect { subject.call }.to raise_error(/is not a string/)
end
end
:server => 'two bottles of rum',
} end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject.call }.to raise_error(/does not match/)
end
end
:options => {},
} end
it 'fails' do
- expect { subject }.to raise_error(/is not a string/)
+ expect { subject.call }.to raise_error(/is not a string/)
end
end
}
end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject.call }.to raise_error(/does not match/)
end
end
apt::key { 'duplicate': id => '#{title}', ensure => 'absent', }"
end
it 'informs the user of the impossibility' do
- expect { subject }.to raise_error(/already ensured as absent/)
+ expect { subject.call }.to raise_error(/already ensured as absent/)
end
end
end
end
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error, /Only integers are allowed/)
end
end
end
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error, /parameter version cannot be used in general form/)
end
end
end
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error, /parameters release and origin are mutually exclusive/)
end
end
end
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error, /parameters release, origin, and version are mutually exclusive/)
end
end
end
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error, /parameters release, origin, and version are mutually exclusive/)
end
end
let(:title) { 'ppa:foo' }
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error, /lsbdistcodename fact not available: release parameter required/)
end
end
let(:title) { 'ppa:foo' }
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error, /not currently supported on Debian/)
end
end
describe 'when using the defaults' do
context 'without source or content' do
it do
- expect { is_expected.to compile }.to raise_error(Puppet::Error, /needs either of /)
+ expect { subject.call }.to raise_error(Puppet::Error, /needs either of /)
end
end
context 'with source and content' do
let(:params) { default_params.merge({ :source => 'la' }) }
it do
- expect { is_expected.to compile }.to raise_error(Puppet::Error, /cannot have both /)
+ expect { subject.call }.to raise_error(Puppet::Error, /cannot have both /)
end
end
let(:title) { 'ext-teddybear' }
let(:params) { default_params }
it do
- expect { is_expected.to compile }.to raise_error(Puppet::Error, /must start with /)
+ expect { subject.call }.to raise_error(Puppet::Error, /must start with /)
end
end
context 'with ensure=banana' do
let(:params) { default_params.merge({ :ensure => 'banana' }) }
it do
- expect { is_expected.to compile }.to raise_error(Puppet::Error, /"banana" does not /)
+ expect { subject.call }.to raise_error(Puppet::Error, /"banana" does not /)
end
end
context 'with priority=1.2' do
let(:params) { default_params.merge({ :priority => 1.2 }) }
it do
- expect { is_expected.to compile }.to raise_error(Puppet::Error, /be an integer /)
+ expect { subject.call }.to raise_error(Puppet::Error, /be an integer /)
end
end
end
end
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error, /source entry without specifying a location/)
end
end
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error, /lsbdistcodename fact not available: release parameter required/)
end
end
it do
expect {
- is_expected.to compile
+ subject.call
}.to raise_error(Puppet::Error, /invalid value for pin/)
end
end