Commit 692d230f authored by Tim Meusel's avatar Tim Meusel

fix spec errors in jenkins_repo_debian_spec.rb

parent b5400e9e
require 'spec_helper'
describe 'jenkins', type: :class do
# Switching OS Family to prevent duplicate declaration
let(:facts) do
{
osfamily: 'Debian',
lsbdistcodename: 'precise',
lsbdistid: 'ubuntu',
operatingsystem: 'Debian',
os: {
name: 'Debian',
release: { full: '11.04' }
}
}
end
on_supported_os.each do |os, facts|
next unless facts[:os]['family'] == 'Debian'
context 'repo::debian' do
shared_examples 'an apt catalog' do
it { is_expected.to contain_class('apt') }
it { is_expected.to contain_apt__source('jenkins').that_notifies('Exec[apt_update]') }
end
context "on #{os} " do
systemd_fact = case facts[:operatingsystemmajrelease]
when '6'
{ systemd: false }
else
{ systemd: true }
end
let :facts do
facts.merge(systemd_fact)
end
describe 'default' do
it_behaves_like 'an apt catalog'
it { is_expected.to contain_apt__source('jenkins').with_location('https://pkg.jenkins.io/debian-stable') }
end
context 'repo::debian' do
shared_examples 'an apt catalog' do
it { is_expected.to contain_class('apt') }
it { is_expected.to contain_apt__source('jenkins').that_notifies('Exec[apt_update]') }
end
describe 'lts = true' do
let(:params) { { lts: true } }
describe 'default' do
it_behaves_like 'an apt catalog'
it { is_expected.to contain_apt__source('jenkins').with_location('https://pkg.jenkins.io/debian-stable') }
end
it_behaves_like 'an apt catalog'
it { is_expected.to contain_apt__source('jenkins').with_location('https://pkg.jenkins.io/debian-stable') }
end
describe 'lts = true' do
let(:params) { { lts: true } }
it_behaves_like 'an apt catalog'
it { is_expected.to contain_apt__source('jenkins').with_location('https://pkg.jenkins.io/debian-stable') }
end
describe 'lts = false' do
let(:params) { { lts: false } }
describe 'lts = false' do
let(:params) { { lts: false } }
it_behaves_like 'an apt catalog'
it { is_expected.to contain_apt__source('jenkins').with_location('https://pkg.jenkins.io/debian') }
it_behaves_like 'an apt catalog'
it { is_expected.to contain_apt__source('jenkins').with_location('https://pkg.jenkins.io/debian') }
end
end
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment