Sha256: 7e2f1b00b7cbf84e6e27f30b40732537bd0b98d8d9be7ec8e8b275579184fa7d

Contents?: true

Size: 1.33 KB

Versions: 8

Compression:

Stored size: 1.33 KB

Contents

require 'common'
require 'net/ssh'

module NetSSH
  class TestStartOptions < Test::Unit::TestCase
    def setup
      authentication_session = mock('authentication_session')
      authentication_session.stubs(:authenticate).returns(true)
      Net::SSH::Authentication::Session.stubs(:new).returns(authentication_session)
      Net::SSH::Transport::Session.stubs(:new).returns(mock('transport_session'))
      Net::SSH::Connection::Session.stubs(:new).returns(mock('connection_session'))
    end

    def test_start_should_accept_keepalive_option
      assert_nothing_raised do
        options = { :keepalive => true }
        Net::SSH.start('localhost', 'testuser', options)
      end
    end

    def test_start_should_accept_keepalive_interval_option
      assert_nothing_raised do
        options = { :keepalive_interval => 10 }
        Net::SSH.start('localhost', 'testuser', options)
      end
    end

    def test_start_should_accept_send_env_option
      assert_nothing_raised do
        options = { :send_env => [ /^LC_.*$/, "LANG" ] }
        Net::SSH.start('localhost', 'testuser', options)
      end
    end

    def test_star_should_accept_number_of_password_prompts_option
      assert_nothing_raised do
        options = { :number_of_password_prompts => 2 }
        Net::SSH.start('localhost', 'testuser', options)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
net-ssh-2.9.4 test/start/test_options.rb
net-ssh-2.9.4.rc1 test/start/test_options.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/net-ssh-2.9.2/test/start/test_options.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/net-ssh-2.9.2/test/start/test_options.rb
net-ssh-2.9.3.beta1 test/start/test_options.rb
net-ssh-2.9.2 test/start/test_options.rb
net-ssh-2.9.2.rc3 test/start/test_options.rb
net-ssh-2.9.2.rc2 test/start/test_options.rb