summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/kubernetes/helm/init_command_spec.rb
blob: e6920b0a76fba76b50e553167b9aaa7a7d0f96f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require 'spec_helper'

describe Gitlab::Kubernetes::Helm::InitCommand do
  let(:application) { create(:clusters_applications_helm) }
  let(:init_command) { described_class.new(application.name) }

  describe '#generate_script' do
    let(:command) do
      <<~MSG.chomp
        set -eo pipefail
        apk add -U ca-certificates openssl >/dev/null
        wget -q -O - https://kubernetes-helm.storage.googleapis.com/helm-v2.7.0-linux-amd64.tar.gz | tar zxC /tmp >/dev/null
        mv /tmp/linux-amd64/helm /usr/bin/
        helm init >/dev/null
      MSG
    end

    subject { init_command.generate_script }

    it 'should return the appropriate command' do
      is_expected.to eq(command)
    end
  end
end