diff --git a/lib/toxiproxy.rb b/lib/toxiproxy.rb index 2228dba..8434545 100644 --- a/lib/toxiproxy.rb +++ b/lib/toxiproxy.rb @@ -225,13 +225,10 @@ def toxics } end + @http = nil def self.reset_http_client! - if defined? @http - @http.finish() if @http && @http.started? - @http = nil - end - - @http + @http.finish if @http&.started? + @http = nil end private