summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-11-25 12:40:14 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2015-11-25 12:40:14 -0800
commit79c7ad25e08b6fdee6df967d9e294ba8c802d4ba (patch)
tree99fb0434386b3bc47e0788710a72027c02e7111b
parent3f5bbc8516073d6af7b6d2aa9b46bc09af57c880 (diff)
downloadchef-79c7ad25e08b6fdee6df967d9e294ba8c802d4ba.tar.gz
restore the old signal handler here
-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