summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2009-01-31 21:37:28 -0700
committerJamis Buck <jamis@37signals.com>2009-01-31 21:37:28 -0700
commiteb1f1e4465bc3358e63d6b9ce05da22ba158492a (patch)
tree54700be13e3f155803d478b0e8d295b754e5de91 /test
parent5da8a7c4a93ed3a595e7955c73641f7ac1a4b50a (diff)
downloadnet-ssh-gateway-eb1f1e4465bc3358e63d6b9ce05da22ba158492a.tar.gz
Allow local port to be specified to Gateway#open
Diffstat (limited to 'test')
-rw-r--r--test/gateway_test.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/gateway_test.rb b/test/gateway_test.rb
index 6194886..8d7fac7 100644
--- a/test/gateway_test.rb
+++ b/test/gateway_test.rb
@@ -27,6 +27,12 @@ class GatewayTest < Test::Unit::TestCase
assert_equal [65000, "app1", 22], gateway_session.forward.active_locals[65000]
end
+ def test_open_with_explicit_local_port_should_use_that_port
+ gateway_session, gateway = new_gateway
+ assert_equal 8181, gateway.open("app1", 22, 8181)
+ assert_equal [8181, "app1", 22], gateway_session.forward.active_locals[8181]
+ end
+
def test_ssh_should_return_connection_when_no_block_is_given
gateway_session, gateway = new_gateway
expect_connect_to("127.0.0.1", "user", :port => 65535).returns(result = mock("session"))
@@ -113,4 +119,4 @@ class GatewayTest < Test::Unit::TestCase
@looping = false
end
end
-end \ No newline at end of file
+end