require 'webrick' class ::WEBrick::BasicLog def log(level, data) end end port = 8000 webserver = Thread.new do server = WEBrick::HTTPServer.new( :Port => port, :DocumentRoot => "#{Dir.pwd}/spec/test_data", Logger: WEBrick::Log.new("/dev/null"), AccessLog: [] ) server.mount "/tmp/", WEBrick::HTTPServlet::FileHandler, "#{Dir.pwd}/tmp/" server.start end puts "staring webserver on port #{port}" webserver.run #webserver.join at_exit { Thread.kill webserver }