spec/support/chef_server.rb in berkshelf-2.0.0.beta vs spec/support/chef_server.rb in berkshelf-2.0.0

- old
+ new

@@ -12,29 +12,28 @@ def request_log @request_log ||= Array.new end def server - @server ||= ChefZero::Server.new(port: PORT, signals: false, log_requests: true) + @server ||= ChefZero::Server.new(port: PORT, generate_real_keys: false) end def server_url - "http://localhost:#{PORT}" + (@server && @server.url) || "http://localhost:#{PORT}" end def start - Thin::Logging.silent = true server.start_background server.on_response do |request, response| request_log << [ request, response ] end clear_request_log server end def stop - @server.stop if @server + @server.stop if running? end def running? @server && @server.running? end