Skip to content
Browse files

kill HTTPS server after usage, don't pollute STDOUT

  • Loading branch information...
1 parent a08e5e8 commit d348e203a8ff03dae9398becc96b1371b5971fa9 @niklasb niklasb committed with halogenandtoast
Showing with 6 additions and 4 deletions.
  1. +6 −2 spec/browser_spec.rb
  2. +0 −2 src/main.cpp
View
8 spec/browser_spec.rb
@@ -46,7 +46,7 @@
# set up SSL layer
serv = OpenSSL::SSL::SSLServer.new(serv, $openssl_self_signed_ctx)
- server_thread = Thread.new(serv) do |serv|
+ @server_thread = Thread.new(serv) do |serv|
while conn = serv.accept do
# read request
request = []
@@ -66,7 +66,11 @@
end
end
- it "doesn't accepts a self-signed certificate by default" do
+ after do
+ @server_thread.kill
+ end
+
+ it "doesn't accept a self-signed certificate by default" do
lambda { browser.visit "https://#{@host}:#{@port}/" }.should raise_error
end
View
2 src/main.cpp
@@ -25,8 +25,6 @@ int main(int argc, char **argv) {
if (server.start()) {
std::cout << "Capybara-webkit server started, listening on port: " << server.server_port() << std::endl;
- if (ignoreSslErrors)
- std::cout << "Ignoring SSL errors" << std::endl;
return app.exec();
} else {
std::cerr << "Couldn't start capybara-webkit server" << std::endl;

0 comments on commit d348e20

Please sign in to comment.
Something went wrong with that request. Please try again.