summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2008-04-05 15:43:24 -0600
committerJamis Buck <jamis@37signals.com>2008-04-05 15:43:24 -0600
commita5d884130d8fbe8180f59cce47cac5f8a9cca931 (patch)
treeb5c77871e3d9c55892608c9780adb663dfc2c819 /test
parentb9be5284a789923dfe239d533c1f64d5a0a686b7 (diff)
downloadnet-ssh-a5d884130d8fbe8180f59cce47cac5f8a9cca931.tar.gz
Make channel open failures work via a callback to parallel how channel open successes work
Diffstat (limited to 'test')
-rw-r--r--test/connection/test_session.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/connection/test_session.rb b/test/connection/test_session.rb
index f4c0265..394e18b 100644
--- a/test/connection/test_session.rb
+++ b/test/connection/test_session.rb
@@ -237,10 +237,11 @@ module Connection
assert_equal "auth-agent", ch.type
end
- def test_channel_open_failure_should_remove_channel_raise_exception
+ def test_channel_open_failure_should_remove_channel_and_tell_channel_that_open_failed
session.channels[1] = stub("channel")
+ session.channels[1].expects(:do_open_failed).with(1234, "some reason")
transport.return(CHANNEL_OPEN_FAILURE, :long, 1, :long, 1234, :string, "some reason", :string, "lang tag")
- assert_raises(Net::SSH::ChannelOpenFailed) { process_times(2) }
+ process_times(2)
assert session.channels.empty?
end