Sha256: b45a3aac4dd918b17fb70bf098436cf4818d146bf512ba85c534b88be887a714

Contents?: true

Size: 1.16 KB

Versions: 31

Compression:

Stored size: 1.16 KB

Contents

describe 'ssh_config executable' do

  # Setup a platform for ssh_config tests
  #
  # Parameters::
  # * *block* (Proc): Code called when the platform is setup
  #   * Parameters::
  #     * *repository* (String): Platform's repository
  def with_test_platform_for_ssh_config(&block)
    with_test_platform({ nodes: { 'node1' => {}, 'node2' => {} } }, &block)
  end

  it 'dumps the SSH config without arguments' do
    with_test_platform_for_ssh_config do
      expect(test_actions_executor.connector(:ssh)).to receive(:ssh_config).with(ssh_exec: 'ssh').and_return('# SSH config')
      exit_code, stdout, stderr = run 'ssh_config'
      expect(exit_code).to eq 0
      expect(stdout).to match(/# SSH config/)
      expect(stderr).to eq ''
    end
  end

  it 'dumps the SSH config with an alternate SSH executable' do
    with_test_platform_for_ssh_config do
      expect(test_actions_executor.connector(:ssh)).to receive(:ssh_config).with(ssh_exec: 'my_ssh').and_return('# SSH config')
      exit_code, stdout, stderr = run 'ssh_config', '--ssh-exec', 'my_ssh'
      expect(exit_code).to eq 0
      expect(stdout).to match(/# SSH config/)
      expect(stderr).to eq ''
    end
  end

end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
hybrid_platforms_conductor-33.9.5 spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb
hybrid_platforms_conductor-33.9.4 spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb
hybrid_platforms_conductor-33.9.2 spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb
hybrid_platforms_conductor-33.9.1 spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb
hybrid_platforms_conductor-33.9.0 spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb
hybrid_platforms_conductor-33.8.4 spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb
hybrid_platforms_conductor-33.8.3 spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb
hybrid_platforms_conductor-33.8.2 spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb
hybrid_platforms_conductor-33.8.1 spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb
hybrid_platforms_conductor-33.8.0 spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb
hybrid_platforms_conductor-33.7.4 spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb
hybrid_platforms_conductor-33.7.3 spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb
hybrid_platforms_conductor-33.7.2 spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb
hybrid_platforms_conductor-33.7.1 spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb
hybrid_platforms_conductor-33.7.0 spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb
hybrid_platforms_conductor-33.6.0 spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb
hybrid_platforms_conductor-33.5.1 spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb
hybrid_platforms_conductor-33.5.0 spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb
hybrid_platforms_conductor-33.4.0 spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb
hybrid_platforms_conductor-33.3.0 spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb