debian-mirror-gitlab/spec/lib/gitlab/kubernetes/config_map_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
935 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'
2020-07-28 23:09:34 +05:30
RSpec.describe Gitlab::Kubernetes::ConfigMap do
2018-03-27 19:54:05 +05:30
let(:kubeclient) { double('kubernetes client') }
2023-05-27 22:25:52 +05:30
let(:name) { 'my-name' }
let(:files) { [] }
let(:config_map) { described_class.new(name, files) }
2018-03-27 19:54:05 +05:30
let(:namespace) { Gitlab::Kubernetes::Helm::NAMESPACE }
let(:metadata) do
{
2023-05-27 22:25:52 +05:30
name: "values-content-configuration-#{name}",
2018-03-27 19:54:05 +05:30
namespace: namespace,
2023-05-27 22:25:52 +05:30
labels: { name: "values-content-configuration-#{name}" }
2018-03-27 19:54:05 +05:30
}
end
describe '#generate' do
2023-05-27 22:25:52 +05:30
let(:resource) do
::Kubeclient::Resource.new(metadata: metadata, data: files)
end
2020-01-01 13:55:28 +05:30
2018-03-27 19:54:05 +05:30
subject { config_map.generate }
2019-07-07 11:18:12 +05:30
it 'builds a Kubeclient Resource' do
2018-03-27 19:54:05 +05:30
is_expected.to eq(resource)
end
end
2018-11-18 11:00:15 +05:30
describe '#config_map_name' do
it 'returns the config_map name' do
2023-05-27 22:25:52 +05:30
expect(config_map.config_map_name)
.to eq("values-content-configuration-#{name}")
2018-11-18 11:00:15 +05:30
end
end
2018-03-27 19:54:05 +05:30
end