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 16c5559
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions spec/classes/repository_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@
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 16c5559

Please sign in to comment.