debian-mirror-gitlab/spec/lib/gitlab/kubernetes/kubeconfig/entry/context_spec.rb

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

24 lines
710 B
Ruby
Raw Normal View History

2021-10-27 15:23:28 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Kubernetes::Kubeconfig::Entry::Context do
describe '#to_h' do
let(:name) { 'name' }
let(:user) { 'user' }
let(:cluster) { 'cluster' }
subject { described_class.new(name: name, user: user, cluster: cluster).to_h }
it { is_expected.to eq({ name: name, context: { cluster: cluster, user: user } }) }
context 'with a namespace' do
let(:namespace) { 'namespace' }
subject { described_class.new(name: name, user: user, cluster: cluster, namespace: namespace).to_h }
it { is_expected.to eq({ name: name, context: { cluster: cluster, user: user, namespace: namespace } }) }
end
end
end