test/port_test.rb in artoo-1.0.0.rc3 vs test/port_test.rb in artoo-1.0.0.rc4
- old
+ new
@@ -3,31 +3,43 @@
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
\ No newline at end of file