Sha256: b06c883f0374aca56e27d8b46c4d739a398fb221856d3d3f446389215caef374

Contents?: true

Size: 642 Bytes

Versions: 3

Compression:

Stored size: 642 Bytes

Contents

require "spec_helper"
require "tagen/socket"

describe BasicSocket do
  describe "#send2 and #recv2" 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.send2("guten")
      c.send2("tag")
      s.recv2.should == "guten"
      s.recv2.should == "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])
      s.recv_obj.should == [1,2]
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tagen-1.1.7 spec/tagen/socket_spec.rb
tagen-1.1.6 spec/tagen/socket_spec.rb
tagen-1.1.5 spec/tagen/socket_spec.rb