family: 'Debian',
name: 'Debian',
release: {
- major: '8',
- full: '8.0',
+ major: '9',
+ full: '9.0'
},
distro: {
- codename: 'jessie',
- id: 'Debian',
- },
- },
+ codename: 'stretch',
+ id: 'Debian'
+ }
+ }
}
end
let(:title) { 'conf-teddybear' }
describe 'when using the defaults' do
context 'without source or content' do
it do
- is_expected.to raise_error(Puppet::Error, %r{needs either of })
+ expect(subject).to raise_error(Puppet::Error, %r{needs either of })
end
end
- context 'with title=conf-teddybear ' do
+ context 'with title=conf-teddybear' do
let(:params) { default_params }
it { is_expected.to contain_file('/etc/apt/apt.conf.d/50teddybear').that_notifies('Class[Apt::Update]') }
let(:params) { { source: 'puppet:///la/die/dah' } }
it {
- is_expected.to contain_file('/etc/apt/apt.conf.d/50teddybear').that_notifies('Class[Apt::Update]').with(ensure: 'file',
- owner: 'root',
- group: 'root',
- source: params[:source].to_s)
+ expect(subject).to contain_file('/etc/apt/apt.conf.d/50teddybear').that_notifies('Class[Apt::Update]').with(ensure: 'file',
+ owner: 'root',
+ group: 'root',
+ source: params[:source].to_s)
}
end
let(:params) { default_params }
it {
- is_expected.to contain_file('/etc/apt/apt.conf.d/50teddybear').that_notifies('Class[Apt::Update]').with(ensure: 'file',
- owner: 'root',
- group: 'root',
- content: params[:content].to_s)
+ expect(subject).to contain_file('/etc/apt/apt.conf.d/50teddybear').that_notifies('Class[Apt::Update]').with(ensure: 'file',
+ owner: 'root',
+ group: 'root',
+ content: params[:content].to_s)
}
end
end
family: 'Debian',
name: 'Debian',
release: {
- major: '8',
- full: '8.0',
+ major: '9',
+ full: '9.0'
},
distro: {
- codename: 'jessie',
- id: 'Debian',
- },
- },
+ codename: 'stretch',
+ id: 'Debian'
+ }
+ }
}
end
let(:title) { 'conf-teddybear' }
let(:params) { default_params.merge(source: 'la') }
it do
- is_expected.to raise_error(Puppet::Error, %r{cannot have both })
+ expect(subject).to raise_error(Puppet::Error, %r{cannot have both })
end
end
let(:params) { default_params }
it do
- is_expected.to raise_error(Puppet::Error, %r{must start with either})
+ expect(subject).to raise_error(Puppet::Error, %r{must start with either})
end
end
let(:params) { default_params.merge(ensure: 'banana') }
it do
- is_expected.to raise_error(Puppet::Error, %r{Enum\['absent', 'file', 'present'\]})
+ expect(subject).to raise_error(Puppet::Error, %r{Enum\['absent', 'file', 'present'\]})
end
end
let(:params) { default_params.merge(ensure: 'absent') }
it {
- is_expected.to contain_file('/etc/apt/apt.conf.d/50teddybear').that_notifies('Class[Apt::Update]').with(ensure: 'absent')
+ expect(subject).to contain_file('/etc/apt/apt.conf.d/50teddybear').that_notifies('Class[Apt::Update]').with(ensure: 'absent')
}
end
end