Sha256: 4e51cd60afcc7984e94984c6839bcc4bbd6ec40437287e52a8bded6bdf1b0ebf

Contents?: true

Size: 659 Bytes

Versions: 1

Compression:

Stored size: 659 Bytes

Contents

require_relative '../spec_helper'

module Kamerling describe Addr do
  let(:addr) { Addr['localhost', 1981, :TCP] }

  describe '#connectable?' do
    it 'is a predicate whether the (TCP) address is connectable' do
      server = TCPServer.new(*addr)
      addr.must_be :connectable?
      server.close
      addr.wont_be :connectable?
    end
  end

  describe '#to_a' do
    it 'returns host + port for splat use' do
      splat = *addr
      splat.must_equal ['localhost', 1981]
    end
  end

  describe '#to_s' do
    it 'returns the Addr in ‘host:port (protocol)’ notation' do
      addr.to_s.must_equal 'localhost:1981 (TCP)'
    end
  end
end end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kamerling-0.0.1 spec/kamerling/addr_spec.rb