Sha256: e2f8908c4d47e1ebfcf8d86b27bfa7e0b31bcdeb22e81ac3313e8caa5fc3ecf6

Contents?: true

Size: 1.38 KB

Versions: 9

Compression:

Stored size: 1.38 KB

Contents

require File.expand_path(File.dirname(__FILE__) + "/test_helper")

describe Artoo::Port do
  before do
    @remote_tcp_port = Artoo::Port.new("192.168.0.1:8080")
    @local_tcp_port = Artoo::Port.new("5678")
    @serial_port = Artoo::Port.new("/dev/tty.usb12345")
    @portless = Artoo::Port.new
  end

  it 'Artoo::Port#port' do
    @remote_tcp_port.port.must_equal "8080"
    @local_tcp_port.port.must_equal "5678"
    @serial_port.port.must_equal "/dev/tty.usb12345"
    @portless.port.must_equal "none"
  end

  it 'Artoo::Port#is_tcp?' do
    @remote_tcp_port.is_tcp?.must_equal true
    @local_tcp_port.is_tcp?.must_equal true
    @serial_port.is_tcp?.must_equal false
    @portless.is_tcp?.must_equal false
  end

  it 'Artoo::Port#is_serial?' do
    @remote_tcp_port.is_serial?.must_equal false
    @local_tcp_port.is_serial?.must_equal false
    @serial_port.is_serial?.must_equal true
    @portless.is_tcp?.must_equal false
  end

  it 'Artoo::Port#is_portless?' do
    @remote_tcp_port.is_portless?.must_equal false
    @local_tcp_port.is_portless?.must_equal false
    @serial_port.is_portless?.must_equal false
    @portless.is_portless?.must_equal true
  end

  it 'Artoo::Port#to_s' do
    @remote_tcp_port.to_s.must_equal "192.168.0.1:8080"
    @local_tcp_port.to_s.must_equal "localhost:5678"
    @serial_port.to_s.must_equal "/dev/tty.usb12345"
    @portless.to_s.must_equal "none"
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
artoo-1.3.0 test/port_test.rb
artoo-1.2.2 test/port_test.rb
artoo-1.2.1 test/port_test.rb
artoo-1.2.0 test/port_test.rb
artoo-1.1.1 test/port_test.rb
artoo-1.1.0 test/port_test.rb
artoo-1.1.0.pre test/port_test.rb
artoo-1.0.0 test/port_test.rb
artoo-1.0.0.rc4 test/port_test.rb