Sha256: f1c80420734ce97baa323bf30df6ca0ea7ca433fc40c6703a3c4e82e8f6183cf
Contents?: true
Size: 534 Bytes
Versions: 5
Compression:
Stored size: 534 Bytes
Contents
require 'rspec' require 'tmpdir' require 'fileutils' require 'socket' shared_context "UNIX Server" do def socket_path(name); File.join(Dir.tmpdir,name); end let(:path) { socket_path('ronin_unix_server') } before(:each) do @server = UNIXServer.new(path) @server_thread = Thread.new do socket = @server.accept begin socket.puts socket.readline ensure socket.close end end end after(:each) do @server_thread.kill @server.close FileUtils.rm(path) end end
Version data entries
5 entries across 5 versions & 1 rubygems