Sha256: 65d02fc4a0a8bd52d8e31b16a6301ac2a55a5a2f6608127eb302177d7eb13cd6

Contents?: true

Size: 1.42 KB

Versions: 5

Compression:

Stored size: 1.42 KB

Contents

describe HybridPlatformsConductor::ActionsExecutor do

  context 'checking connector plugin ssh' do

    context 'checking Config DSL extensions' do

      it 'returns 1 defined gateway' do
        with_repository do |repository|
          with_platforms 'gateway :gateway1, \'\'' do
            expect(test_config.known_gateways).to eq [:gateway1]
          end
        end
      end

      it 'returns 1 defined gateway with its content' do
        ssh_gateway = '
          Host gateway
            Hostname mygateway.com
        '
        with_repository do |repository|
          with_platforms "gateway :gateway1, '#{ssh_gateway}'" do
            expect(test_config.ssh_for_gateway(:gateway1)).to eq ssh_gateway
          end
        end
      end

      it 'returns 1 defined gateway with its content and replacing ERB template correctly' do
        with_repository do |repository|
          with_platforms 'gateway :gateway1, \'Host gateway_<%= @user %>\'' do
            expect(test_config.ssh_for_gateway(:gateway1, user: 'test_user')).to eq 'Host gateway_test_user'
          end
        end
      end

      it 'returns several defined gateways' do
        with_repository do |repository|
          with_platforms '
            gateway :gateway1, \'\'
            gateway :gateway2, \'\'
          ' do
            expect(test_config.known_gateways.sort).to eq %i[gateway1 gateway2].sort
          end
        end
      end

    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hybrid_platforms_conductor-32.5.0 spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/config_dsl_spec.rb
hybrid_platforms_conductor-32.4.2 spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/config_dsl_spec.rb
hybrid_platforms_conductor-32.4.1 spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/config_dsl_spec.rb
hybrid_platforms_conductor-32.4.0 spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/config_dsl_spec.rb
hybrid_platforms_conductor-32.3.6 spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/config_dsl_spec.rb