summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/unit/knife/ssl_check_spec.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/unit/knife/ssl_check_spec.rb b/spec/unit/knife/ssl_check_spec.rb
index fd46c47d99..a9d1145f34 100644
--- a/spec/unit/knife/ssl_check_spec.rb
+++ b/spec/unit/knife/ssl_check_spec.rb
@@ -181,7 +181,7 @@ E
let(:self_signed_crt) { OpenSSL::X509::Certificate.new(File.read(self_signed_crt_path)) }
before do
- trap(:INT, "DEFAULT")
+ @old_signal = trap(:INT, "DEFAULT")
expect(TCPSocket).to receive(:new).
with("foo.example.com", 8443).
@@ -191,6 +191,10 @@ E
and_return(ssl_socket_for_debug)
end
+ after do
+ trap(:INT, @old_signal)
+ end
+
context "when the certificate's CN does not match the hostname" do
before do
expect(ssl_check).to receive(:verify_X509).and_return(true) # X509 valid certs