From 68ef66ec20ea8c61627f20a1cdbd53a297f9aa84 Mon Sep 17 00:00:00 2001 From: Brian Vanderbusch Date: Thu, 13 Apr 2017 20:05:41 -0500 Subject: [PATCH] ensure coverage not lost ensuring coverage was not removed for any resources that were already covered --- spec/classes/init_spec.rb | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index c473e2a7..9e01907b 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -21,23 +21,31 @@ case facts[:osfamily] when 'Debian' it { is_expected.to contain_apt__source('gitlab_official_ce') } - when 'redhat' + when 'RedHat' it { is_expected.to contain_yumrepo('gitlab_official_ce') } end - if facts[:gitlab_systemd] == "absent" + if ! facts[:gitlab_systemd] it { is_expected.to contain_file('/etc/init.d/gitlab-runsvdir').with_ensure('link') } + else + it { is_expected.to contain_file('/etc/init.d/gitlab-runsvdir').with_ensure('absent') } end end + context "with custom facts" do + + end context "with class specific parameters" do - describe 'edition = ce' do - let(:params) { {:edition => 'ce'} } - it { is_expected.to contain_package('gitlab-ce').with_ensure('installed') } - end describe 'edition = ee' do let(:params) { {:edition => 'ee'} } it { is_expected.to contain_package('gitlab-ee').with_ensure('installed') } + + case facts[:osfamily] + when 'Debian' + it { is_expected.to contain_apt__source('gitlab_official_ee') } + when 'RedHat' + it { is_expected.to contain_yumrepo('gitlab_official_ee') } + end end describe 'external_url' do let(:params) { {:external_url => 'http://gitlab.mycompany.com/'} }