debian-mirror-gitlab/spec/lib/gitlab/kubernetes/helm/base_command_spec.rb

40 lines
822 B
Ruby
Raw Normal View History

2020-01-01 13:55:28 +05:30
# frozen_string_literal: true
2018-03-27 19:54:05 +05:30
require 'spec_helper'
describe Gitlab::Kubernetes::Helm::BaseCommand do
2020-05-24 23:13:21 +05:30
subject(:base_command) do
test_class.new(rbac)
end
2018-03-27 19:54:05 +05:30
let(:application) { create(:clusters_applications_helm) }
2018-11-20 20:47:30 +05:30
let(:rbac) { false }
2018-11-18 11:00:15 +05:30
let(:test_class) do
2020-06-23 00:09:42 +05:30
Class.new(Gitlab::Kubernetes::Helm::BaseCommand) do
2018-11-20 20:47:30 +05:30
def initialize(rbac)
2020-06-23 00:09:42 +05:30
super(
name: 'test-class-name',
rbac: rbac,
files: { some: 'value' },
local_tiller_enabled: false
)
2018-11-18 11:00:15 +05:30
end
end
end
2020-05-24 23:13:21 +05:30
it_behaves_like 'helm command generator' do
2018-10-15 14:42:47 +05:30
let(:commands) { '' }
2018-03-27 19:54:05 +05:30
end
describe '#pod_name' do
subject { base_command.pod_name }
2018-11-18 11:00:15 +05:30
it { is_expected.to eq('install-test-class-name') }
2018-03-27 19:54:05 +05:30
end
2020-04-22 19:07:51 +05:30
2020-05-24 23:13:21 +05:30
it_behaves_like 'helm command' do
let(:command) { base_command }
2020-04-22 19:07:51 +05:30
end
2018-03-27 19:54:05 +05:30
end