]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
Change order of tests to be more logical
authorMatt Bostock <matt@mattbostock.com>
Fri, 8 Jan 2016 11:06:57 +0000 (11:06 +0000)
committerMatt Bostock <matt@mattbostock.com>
Fri, 8 Jan 2016 11:09:45 +0000 (11:09 +0000)
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

index bfa7e38f63e2fa6596ea9adb25a89e9aa4c046c6..eb63310059e22ec34980503291f10cd4b22cb7d1 100755 (executable)
@@ -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