Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorentPoinsaut committed Mar 15, 2022
1 parent 7d5719c commit 2f0a626
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions spec/classes/repository_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,16 @@
end

context 'with default values for all parameters' do
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('bareos::repository') }
if (facts[:osfamily] == 'Debian') && (facts[:operatingsystemmajrelease] == '11')
it 'fails' do
expect {
is_expected.to contain_class('bareos::repository')
}.to raise_error(Puppet::PreformattedError, %r{is not distributed for})
end
else
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('bareos::repository') }
end
end

case facts[:osfamily]
Expand Down

0 comments on commit 2f0a626

Please sign in to comment.