Sha256: 1a1d6d8b3a53b3a51fce777d92759adfde5b87af663a3183f9e28ef0dac8d9cb

Contents?: true

Size: 1.17 KB

Versions: 20

Compression:

Stored size: 1.17 KB

Contents

require 'spec_helper'
require 'net/ssh'

module Beaker
  describe SshConnection do
    let( :host )     { 'my_host' }
    let( :user )     { 'root'    }
    let( :ssh_opts ) { {} }
    let( :options )  { { :logger => double('logger').as_null_object }  }
    subject(:connection) { SshConnection.new host, user, ssh_opts, options }

    it 'self.connect creates connects and returns a proxy for that connection' do
      # grrr
      Net::SSH.should_receive(:start).with( host, user, ssh_opts )
      connection_constructor = SshConnection.connect host, user, ssh_opts, options
      expect( connection_constructor ).to be_a_kind_of SshConnection
    end

    it 'connect creates a new connection' do
      Net::SSH.should_receive( :start ).with( host, user, ssh_opts)
      connection.connect
    end

    it 'connect caches its connection' do
      Net::SSH.should_receive( :start ).with( host, user, ssh_opts ).once.and_return true
      connection.connect
      connection.connect
    end

    it 'close?'
    it 'execute'
    it 'request_terminal_for'
    it 'register_stdout_for'
    it 'register_stderr_for'
    it 'register_exit_code_for'
    it 'process_stdin_for'
    it 'scp'

  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
beaker-1.21.0 spec/beaker/ssh_connection_spec.rb
beaker-1.20.1 spec/beaker/ssh_connection_spec.rb
beaker-1.20.0 spec/beaker/ssh_connection_spec.rb
beaker-1.19.1 spec/beaker/ssh_connection_spec.rb
beaker-1.19.0 spec/beaker/ssh_connection_spec.rb
beaker-1.18.0 spec/beaker/ssh_connection_spec.rb
beaker-1.17.7 spec/beaker/ssh_connection_spec.rb
beaker-1.17.6 spec/beaker/ssh_connection_spec.rb
beaker-1.17.5 spec/beaker/ssh_connection_spec.rb
beaker-1.17.4 spec/beaker/ssh_connection_spec.rb
beaker-1.17.3 spec/beaker/ssh_connection_spec.rb
beaker-1.17.2 spec/beaker/ssh_connection_spec.rb
beaker-1.17.1 spec/beaker/ssh_connection_spec.rb
beaker-1.17.0 spec/beaker/ssh_connection_spec.rb
beaker-1.16.0 spec/beaker/ssh_connection_spec.rb
beaker-1.15.0 spec/beaker/ssh_connection_spec.rb
beaker-1.14.1 spec/beaker/ssh_connection_spec.rb
beaker-1.14.0 spec/beaker/ssh_connection_spec.rb
beaker-1.13.1 spec/beaker/ssh_connection_spec.rb
beaker-1.13.0 spec/beaker/ssh_connection_spec.rb