summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hörberg <carl.hoerberg@gmail.com>2013-11-30 15:44:06 +0700
committerCarl Hörberg <carl.hoerberg@gmail.com>2013-11-30 15:44:06 +0700
commitcf6fbb280b9c000f0f8a82680a8ed4e84f72f0a6 (patch)
tree5eb91b3a7379a082e4a0db4753f9768a506217e6
parentaabd191dfa0342d7fb873c39b4cd97d40b81a9a2 (diff)
downloadnet-ssh-cf6fbb280b9c000f0f8a82680a8ed4e84f72f0a6.tar.gz
Assert that the return value from ssh block is returned
-rw-r--r--test/start/test_connection.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/start/test_connection.rb b/test/start/test_connection.rb
index 94b68c4..43cbf0e 100644
--- a/test/start/test_connection.rb
+++ b/test/start/test_connection.rb
@@ -39,6 +39,15 @@ module NetSSH
# We aren't interested in the exception
end
end
+
+ def test_return_value_is_returned
+ @connection_session.expects(:closed?).returns(false)
+ @connection_session.expects(:close).once
+
+ val = 1
+ retval = Net::SSH.start('localhost', 'testuser') { val }
+ assert_equal(val, retval)
+ end
end
end