Sha256: b4399ddaf06049e41aa4840ba49469d9dd968d84137fa7ec0864cc38c0d1dfb1

Contents?: true

Size: 639 Bytes

Versions: 5

Compression:

Stored size: 639 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

RSpec.describe UDPSocket do
  let(:udp_port) { 23_456 }

  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

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
nio4r-2.1.0-java spec/nio/selectables/udp_socket_spec.rb
nio4r-2.1.0 spec/nio/selectables/udp_socket_spec.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/nio4r-2.0.0/spec/nio/selectables/udp_socket_spec.rb
nio4r-2.0.0-java spec/nio/selectables/udp_socket_spec.rb
nio4r-2.0.0 spec/nio/selectables/udp_socket_spec.rb