Sha256: a29a5d16af7fd95727aeff7f7c7667180cef536244d425891a12c89249109f0d
Contents?: true
Size: 407 Bytes
Versions: 28
Compression:
Stored size: 407 Bytes
Contents
class StubServer module Server def receive_data(data) send_data @response close_connection_after_writing end def response=(response) @response = response end end def initialize(response, port=8081) @sig = EventMachine::start_server("127.0.0.1", port, Server) { |s| s.response = response } end def stop EventMachine.stop_server @sig end end
Version data entries
28 entries across 28 versions & 2 rubygems