File: udp_socket_spec.rb

package info (click to toggle)
ruby-nio4r 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 528 kB
  • ctags: 1,100
  • sloc: ansic: 5,635; ruby: 679; java: 348; makefile: 5
file content (31 lines) | stat: -rw-r--r-- 601 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require 'spec_helper'

describe UDPSocket do
  let(:udp_port) { 23456 }

  let :readable_subject do
    sock = UDPSocket.new
    sock.bind('localhost', udp_port)

    peer = UDPSocket.new
    peer.send("hi there", 0, 'localhost', udp_port)

    sock
  end

  let :unreadable_subject do
    sock = UDPSocket.new
    sock.bind('localhost', udp_port + 1)
    sock
  end

  let :writable_subject do
    pending "come up with a writable UDPSocket example"
  end

  let :unwritable_subject do
    pending "come up with a UDPSocket that's blocked on writing"
  end

  it_behaves_like "an NIO selectable"
end