Sha256: 6a0013c3cc75f009078c47b01cfa9fa7a7598b26e1c4ba2810ff57f405fbc88c

Contents?: true

Size: 647 Bytes

Versions: 3

Compression:

Stored size: 647 Bytes

Contents

require "spec_helper"
require "tagen/socket"

describe BasicSocket do
  describe "#send2, recv2" do
    it do
      s = TCPServer.open("127.0.0.1", 0)
      af, port, host, addr = s.addr
      c = TCPSocket.open(host, port)
      s = s.accept
      c.send2("guten")
      c.send2("tag")

      expect(s.recv2).to eq("guten")
      expect(s.recv2).to eq("tag")
    end
  end

  describe "#send_obj and #recv_obj" do
    it "works" do
      s = TCPServer.open("127.0.0.1", 0)
      af, port, host, addr = s.addr
      c = TCPSocket.open(host, port)
      s = s.accept
      c.send_obj([1,2])

      expect(s.recv_obj).to eq([1,2])
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tagen-2.0.2 spec/tagen/socket_spec.rb
tagen-2.0.1 spec/tagen/socket_spec.rb
tagen-2.0.0 spec/tagen/socket_spec.rb