Also enable future parser testing. Need to allow failures with future
parser for now since none of the published gems have the fix for
PUP-4379
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.0"
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
notifications:
email: false
group :development, :unit_tests do
gem 'rake', :require => false
gem 'rspec-core', '3.1.7', :require => 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
gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint', :require => false
gem 'simplecov', :require => false
}.to raise_error(Puppet::Error, /If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key/)
end
end
}.to raise_error(Puppet::Error, /If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key/)
end
end
}.to raise_error(Puppet::Error, /If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key/)
end
end
}.to raise_error(Puppet::Error, /If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key/)
end
end
}.to raise_error(Puppet::Error, /If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key/)
end
end
}.to raise_error(Puppet::Error, /If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key/)
end
end
}.to raise_error(Puppet::Error, /If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key/)
end
end
}.to raise_error(Puppet::Error, /If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key/)
end
end
}.to raise_error(Puppet::Error, /is not a string/)
end
end
}.to raise_error(Puppet::Error, /is not a string/)
end
end
}.to raise_error(Puppet::Error, /is not a string/)
end
end
}.to raise_error(Puppet::Error, /is not a string/)
end
end
}.to raise_error(Puppet::Error, /is not a string/)
end
end
}.to raise_error(Puppet::Error, /is not a string/)
end
end
}.to raise_error(Puppet::Error, /is not a string/)
end
end
}.to raise_error(Puppet::Error, /is not a string/)
end
end
}.to raise_error(Puppet::Error, /pin must be either a string, number or hash/)
end
end
}.to raise_error(Puppet::Error, /pin must be either a string, number or hash/)
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({
})}
it { is_expected.to contain_file('sources.list.d').with({
let(:params) { { :purge => { 'sources.list' => 'banana' }, } }
it do
expect {
let(:params) { { :purge => { 'sources.list' => 'banana' }, } }
it do
expect {
}.to raise_error(Puppet::Error)
end
end
}.to raise_error(Puppet::Error)
end
end
let(:params) { { :purge => { 'sources.list.d' => 'banana' }, } }
it do
expect {
let(:params) { { :purge => { 'sources.list.d' => 'banana' }, } }
it do
expect {
}.to raise_error(Puppet::Error)
end
end
}.to raise_error(Puppet::Error)
end
end
let(:params) { { :purge => { 'preferences' => 'banana' }, } }
it do
expect {
let(:params) { { :purge => { 'preferences' => 'banana' }, } }
it do
expect {
}.to raise_error(Puppet::Error)
end
end
}.to raise_error(Puppet::Error)
end
end
let(:params) { { :purge => { 'preferences.d' => 'banana' }, } }
it do
expect {
let(:params) { { :purge => { 'preferences.d' => 'banana' }, } }
it do
expect {
}.to raise_error(Puppet::Error)
end
end
}.to raise_error(Puppet::Error)
end
end
}.to raise_error(Puppet::Error, /This module only works on Debian or derivatives like Ubuntu/)
end
end
}.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
# 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
end
describe "With lsb-release not installed" do
- let(:facts) { { :lsbdistid => '', :osfamily => 'Debian' } }
+ let(:facts) { { :osfamily => 'Debian' } }
let (:title) { 'my_package' }
it do
expect {
let (:title) { 'my_package' }
it do
expect {
}.to raise_error(Puppet::Error, /Unable to determine lsbdistid, is lsb-release installed/)
end
end
}.to raise_error(Puppet::Error, /Unable to determine lsbdistid, is lsb-release installed/)
end
end
- expect { subject } .to raise_error(/pass in content/)
+ expect { subject.call } .to raise_error(/pass in content/)
:server => '-pgp.mit.edu',
} end
it 'fails' do
: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/)
:server => '.pgp.mit.edu',
} end
it 'fails' do
: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/)
:server => "pgp.mit.edu.",
} end
it 'fails' do
: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
end
context "exceed character url" 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
end
context "incorrect port number url" 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
end
context "incorrect protocol for url" 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
end
context "missing port number url" 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
end
context "url ending with a dot" 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
end
end
context "url begin with a dash" do
:server => "hkp://-pgp.mit.edu",
} end
it 'fails' 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
end
end
context 'invalid key' do
'Out of rum. Why? Why are we out of rum?'
end
it 'fails' 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/)
:source => 'afp://puppetlabs.com/key.gpg',
} end
it 'fails' do
: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/)
:content => [],
} end
it 'fails' do
:content => [],
} end
it 'fails' do
- expect { subject }.to raise_error(/is not a string/)
+ expect { subject.call }.to raise_error(/is not a string/)
:server => 'two bottles of rum',
} end
it 'fails' do
: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/)
:options => {},
} end
it 'fails' do
:options => {},
} end
it 'fails' do
- expect { subject }.to raise_error(/is not a string/)
+ expect { subject.call }.to raise_error(/is not a string/)
- expect { subject }.to raise_error(/does not match/)
+ expect { subject.call }.to raise_error(/does not match/)
apt::key { 'duplicate': id => '#{title}', ensure => 'absent', }"
end
it 'informs the user of the impossibility' do
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/)
}.to raise_error(Puppet::Error, /Only integers are allowed/)
end
end
}.to raise_error(Puppet::Error, /Only integers are allowed/)
end
end
}.to raise_error(Puppet::Error, /parameter version cannot be used in general form/)
end
end
}.to raise_error(Puppet::Error, /parameter version cannot be used in general form/)
end
end
}.to raise_error(Puppet::Error, /parameters release and origin are mutually exclusive/)
end
end
}.to raise_error(Puppet::Error, /parameters release and origin are mutually exclusive/)
end
end
}.to raise_error(Puppet::Error, /parameters release, origin, and version are mutually exclusive/)
end
end
}.to raise_error(Puppet::Error, /parameters release, origin, and version are mutually exclusive/)
end
end
}.to raise_error(Puppet::Error, /parameters release, origin, and version are mutually exclusive/)
end
end
}.to raise_error(Puppet::Error, /parameters release, origin, and version are mutually exclusive/)
end
end
let(:title) { 'ppa:foo' }
it do
expect {
let(:title) { 'ppa:foo' }
it do
expect {
}.to raise_error(Puppet::Error, /lsbdistcodename fact not available: release parameter required/)
end
end
}.to raise_error(Puppet::Error, /lsbdistcodename fact not available: release parameter required/)
end
end
let(:title) { 'ppa:foo' }
it do
expect {
let(:title) { 'ppa:foo' }
it do
expect {
}.to raise_error(Puppet::Error, /not currently supported on Debian/)
end
end
}.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
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 /)
context 'with source and content' do
let(:params) { default_params.merge({ :source => 'la' }) }
it do
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 /)
let(:title) { 'ext-teddybear' }
let(:params) { default_params }
it do
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
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
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 /)
}.to raise_error(Puppet::Error, /source entry without specifying a location/)
end
end
}.to raise_error(Puppet::Error, /source entry without specifying a location/)
end
end
}.to raise_error(Puppet::Error, /lsbdistcodename fact not available: release parameter required/)
end
end
}.to raise_error(Puppet::Error, /lsbdistcodename fact not available: release parameter required/)
end
end
}.to raise_error(Puppet::Error, /invalid value for pin/)
end
end
}.to raise_error(Puppet::Error, /invalid value for pin/)
end
end