From eef5216728777267d479a884f67ad222bbf3cfe5 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 11 May 2018 10:10:58 +0200 Subject: [PATCH] increase spec test coverage --- spec/classes/nginx_spec.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/spec/classes/nginx_spec.rb b/spec/classes/nginx_spec.rb index 174b59cc4..5cb318db6 100644 --- a/spec/classes/nginx_spec.rb +++ b/spec/classes/nginx_spec.rb @@ -60,6 +60,24 @@ it { is_expected.to contain_yumrepo('passenger').that_comes_before('Package[nginx]') } end + context 'using default repo without passenger' do + let(:params) { { purge_passenger_repo: false } } + + it { is_expected.to contain_package('nginx') } + it do + is_expected.to contain_yumrepo('nginx-release').with( + 'baseurl' => "http://nginx.org/packages/#{facts[:operatingsystem] == 'CentOS' ? 'centos' : 'rhel'}/#{facts[:operatingsystemmajrelease]}/$basearch/", + 'descr' => 'nginx repo', + 'enabled' => '1', + 'gpgcheck' => '1', + 'priority' => '1', + 'gpgkey' => 'http://nginx.org/keys/nginx_signing.key' + ) + end + + it { is_expected.not_to contain_yumrepo('passenger') } + end + context 'package_source => nginx-mainline' do let(:params) { { package_source: 'nginx-mainline' } }