Sha256: c5622dde111489da5461775953babfa0ed7f2c5a82c5a73446a60f418eccf341
Contents?: true
Size: 1.05 KB
Versions: 17
Compression:
Stored size: 1.05 KB
Contents
require 'pio/set_transport_port' describe Pio::SetTransportDstPort do describe '.new' do When(:set_transport_dst_port) { Pio::SetTransportDstPort.new(port_number) } context 'with 100' do When(:port_number) { 100 } describe '#port_number' do Then { set_transport_dst_port.port_number == 100 } end describe '#type' do Then { set_transport_dst_port.type == 10 } end describe '#message_length' do Then { set_transport_dst_port.message_length == 8 } end describe '#to_binary' do Then { set_transport_dst_port.to_binary.length == 8 } end end context 'with -1' do When(:port_number) { -1 } Then { set_transport_dst_port == Failure(ArgumentError) } end context 'with 2**16' do When(:port_number) { 2**16 } Then { set_transport_dst_port == Failure(ArgumentError) } end context 'with :INVALID_PORT_NUMBER' do When(:port_number) { :INVALID_PORT_NUMBER } Then { set_transport_dst_port == Failure(TypeError) } end end end
Version data entries
17 entries across 17 versions & 1 rubygems