From 41f9319bbd96547f9c2226524918e4b748527048 Mon Sep 17 00:00:00 2001 From: Matt Bostock Date: Fri, 8 Jan 2016 11:06:57 +0000 Subject: Change order of tests to be more logical Put the tests using a valid certificate fixture together and put tests using a valid key fixture together. --- spec/functions/validate_x509_rsa_key_pair_spec.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/functions/validate_x509_rsa_key_pair_spec.rb b/spec/functions/validate_x509_rsa_key_pair_spec.rb index bfa7e38..eb63310 100755 --- a/spec/functions/validate_x509_rsa_key_pair_spec.rb +++ b/spec/functions/validate_x509_rsa_key_pair_spec.rb @@ -126,10 +126,6 @@ EOS end context 'bad input' do - describe 'valid but indented certificate, valid key' do - it { is_expected.to run.with_params(valid_cert_but_indented, valid_key).and_raise_error(Puppet::ParseError, /Not a valid x509 certificate/) } - end - describe 'valid certificate, valid but indented key' do it { is_expected.to run.with_params(valid_cert, valid_key_but_indented).and_raise_error(Puppet::ParseError, /Not a valid RSA key/) } end @@ -138,14 +134,18 @@ EOS it { is_expected.to run.with_params(valid_cert, malformed_key).and_raise_error(Puppet::ParseError, /Not a valid RSA key/) } end - describe 'malformed certificate, valid key' do - it { is_expected.to run.with_params(malformed_cert, valid_key).and_raise_error(Puppet::ParseError, /Not a valid x509 certificate/) } - end - describe 'valid certificate, bad key' do it { is_expected.to run.with_params(valid_cert, bad_key).and_raise_error(Puppet::ParseError, /Not a valid RSA key/) } end + describe 'valid but indented certificate, valid key' do + it { is_expected.to run.with_params(valid_cert_but_indented, valid_key).and_raise_error(Puppet::ParseError, /Not a valid x509 certificate/) } + end + + describe 'malformed certificate, valid key' do + it { is_expected.to run.with_params(malformed_cert, valid_key).and_raise_error(Puppet::ParseError, /Not a valid x509 certificate/) } + end + describe 'bad certificate, valid key' do it { is_expected.to run.with_params(bad_cert, valid_key).and_raise_error(Puppet::ParseError, /Not a valid x509 certificate/) } end -- cgit v1.2.3