Skip to content

Commit

Permalink
fix spec test
Browse files Browse the repository at this point in the history
  • Loading branch information
rtib committed Mar 26, 2024
1 parent 7233df4 commit 2185c2c
Showing 1 changed file with 2 additions and 28 deletions.
30 changes: 2 additions & 28 deletions spec/defines/openssl_certificate_x509_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@
it { is_expected.to compile.and_raise_error(%r{got ['barz|Sting]}) }
end

context 'when not passing a country' do
context 'when not passing a country, organization, unit, state and commonname' do
let(:params) do
{
organization: 'bar',
commonname: 'baz',
base_dir: '/tmp/foo',
}
end

it { is_expected.to compile.and_raise_error(%r{\bcountry\b}) }
it { is_expected.to compile.and_raise_error(%r{At least one of $country, $organization, $unit, $state or $commonname is required.}) }

Check failure on line 28 in spec/defines/openssl_certificate_x509_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

openssl::certificate::x509 when not passing a country, organization, unit, state and commonname is expected to fail to compile and raise an error matching /At least one of $country, $organization, $unit, $state or $commonname is required./ Failure/Error: it { is_expected.to compile.and_raise_error(%r{At least one of $country, $organization, $unit, $state or $commonname is required.}) } error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, At least one of $country, $organization, $unit, $state or $commonname is required. (file: /home/runner/work/puppet-openssl/puppet-openssl/spec/fixtures/modules/openssl/manifests/certificate/x509.pp, line: 152, column: 5) (line: 2) on node fv-az700-446.v5hcyuhipjuubowh0ptkzundnd.bx.internal.cloudapp.net
end

context 'when passing wrong type for country' do
Expand All @@ -43,18 +41,6 @@
it { is_expected.to compile.and_raise_error(%r{got Boolean}) }
end

context 'when not passing an organization' do
let(:params) do
{
country: 'CH',
commonname: 'baz',
base_dir: '/tmp/foo',
}
end

it { is_expected.to compile.and_raise_error(%r{\borganization\b}) }
end

context 'when passing wrong type for organization' do
let(:params) do
{
Expand All @@ -68,18 +54,6 @@
it { is_expected.to compile.and_raise_error(%r{got Boolean}) }
end

context 'when not passing an commonname' do
let(:params) do
{
country: 'CH',
organization: 'bar',
base_dir: '/tmp/foo',
}
end

it { is_expected.to compile.and_raise_error(%r{\bcommonname\b}) }
end

context 'when passing wrong type for commonname' do
let(:params) do
{
Expand Down

0 comments on commit 2185c2c

Please sign in to comment.