Sha256: 5a0b6672d17f817ea41578728dd94fbaf57b8356dbdacea67160ee2b749cfe53

Contents?: true

Size: 904 Bytes

Versions: 40

Compression:

Stored size: 904 Bytes

Contents

require 'common'
require 'net/ssh'

module NetSSH
  class TestStartUserNil < Test::Unit::TestCase
    def setup
      @authentication_session = mock('authentication_session')
      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_nil_user
      @authentication_session.stubs(:authenticate).returns(true)
      assert_nothing_raised do
        Net::SSH.start('localhost')
      end
    end

    def test_start_should_use_default_user_when_nil
      @authentication_session.stubs(:authenticate).with() {|_next_service, user, _password| user == Etc.getlogin }.returns(true)
      assert_nothing_raised do
        Net::SSH.start('localhost')
      end
    end
  end
end

Version data entries

40 entries across 32 versions & 4 rubygems

Version Path
savant-echo-1.0.4 bin/packaging/vendor/ruby/2.2.0/gems/net-ssh-3.2.0/test/start/test_user_nil.rb
savant-echo-1.0.4 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/net-ssh-3.2.0/test/start/test_user_nil.rb
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/net-ssh-3.0.2/test/start/test_user_nil.rb
savant-echo-1.0.1 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/net-ssh-3.2.0/test/start/test_user_nil.rb
savant-echo-1.0.1 bin/packaging/vendor/ruby/2.2.0/gems/net-ssh-3.2.0/test/start/test_user_nil.rb
savant-echo-0.1.91 bin/packaging/vendor/ruby/2.2.0/gems/net-ssh-3.2.0/test/start/test_user_nil.rb
savant-echo-0.1.91 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/net-ssh-3.2.0/test/start/test_user_nil.rb
savant-echo-0.1.9 bin/packaging/vendor/ruby/2.2.0/gems/net-ssh-3.2.0/test/start/test_user_nil.rb
savant-echo-0.1.9 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/net-ssh-3.2.0/test/start/test_user_nil.rb
savant-echo-0.1.6 bin/packaging/vendor/ruby/2.2.0/gems/net-ssh-3.2.0/test/start/test_user_nil.rb
savant-echo-0.1.6 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/net-ssh-3.2.0/test/start/test_user_nil.rb
savant-echo-0.1.5 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/net-ssh-3.2.0/test/start/test_user_nil.rb
savant-echo-0.1.5 bin/packaging/vendor/ruby/2.2.0/gems/net-ssh-3.2.0/test/start/test_user_nil.rb
savant-echo-0.1.4 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/net-ssh-3.2.0/test/start/test_user_nil.rb
savant-echo-0.1.4 bin/packaging/vendor/ruby/2.2.0/gems/net-ssh-3.2.0/test/start/test_user_nil.rb
savant-echo-0.1.3 bin/packaging/vendor/ruby/2.2.0/gems/net-ssh-3.2.0/test/start/test_user_nil.rb
savant-echo-0.1.3 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/net-ssh-3.2.0/test/start/test_user_nil.rb
net-ssh-3.3.0.beta1 test/start/test_user_nil.rb
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/gems/net-ssh-3.0.2/test/start/test_user_nil.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/gems/net-ssh-3.0.2/test/start/test_user_nil.rb