Permalink
Browse files

Add unit tests for Debugger.ctrl_port/cmd_port.

  • Loading branch information...
1 parent b8ee2b5 commit 8fec9b4793966ae53d212ff6965021aca61e2f77 @FooBarWidget FooBarWidget committed Jul 18, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 test/test-remote.rb
View
@@ -0,0 +1,14 @@
+#!/usr/bin/env ruby
+require 'test/unit'
+require 'socket'
+
+# Test Debugger.start_remote, Debugger.cmd_port and Debugger.ctrl_port
+class TestRemote < Test::Unit::TestCase
+ def test_remote
+ Debugger.start_remote('127.0.0.1', [0, 0])
+ assert_block { Debugger.ctrl_port > 0 }
+ assert_block { Debugger.cmd_port > 0 }
+ assert_nothing_raised { TCPSocket.new('127.0.0.1', Debugger.ctrl_port).close }
+ assert_nothing_raised { TCPSocket.new('127.0.0.1', Debugger.cmd_port).close }
+ end
+end

0 comments on commit 8fec9b4

Please sign in to comment.