Sha256: 07ea79f47bd5295183f4fae33e7d6944f2a957e77f7c435448759e1ba5e3ba49
Contents?: true
Size: 849 Bytes
Versions: 84
Compression:
Stored size: 849 Bytes
Contents
require 'common' require 'net/ssh' module NetSSH class TestStart < Test::Unit::TestCase attr_reader :transport_session attr_reader :authentication_session def setup @transport_session = mock('transport_session') @authentication_session = mock('authentication_session') Net::SSH::Transport::Session.expects(:new => transport_session) Net::SSH::Authentication::Session.expects(:new => authentication_session) end def test_close_transport_when_authentication_fails authentication_session.expects(:authenticate => false) transport_session.expects(:close).at_least_once begin Net::SSH.start('localhost', 'testuser') {} rescue Net::SSH::AuthenticationFailed # Authentication should fail, as it is part of the context end end end end
Version data entries
84 entries across 74 versions & 11 rubygems