Sha256: 78f93bd6002665685559278c6292112bb93cbd793f15a42e60447c9dbbadb6a2

Contents?: true

Size: 1.24 KB

Versions: 38

Compression:

Stored size: 1.24 KB

Contents

require 'spec_helper'

describe Conjur::Command::Layers, logged_in: true do
  let(:layer) { double(:layer) }
  
  [ "layer hosts add", "layer:hosts:add" ].each do |cmd|
    describe_command "#{cmd} the-layer the-host" do
      it "adds a host id to the layer" do
        expect_any_instance_of(Conjur::API).to receive(:layer).with("the-layer").and_return layer
        expect(layer).to receive(:add_host).with("the-account:host:the-host")
  
        expect { invoke }.to write("Host added")
      end
    end
    describe_command "#{cmd} the-layer host:the-host" do
      it "adds a qualified host id to the layer" do
        expect_any_instance_of(Conjur::API).to receive(:layer).with("the-layer").and_return layer
        expect(layer).to receive(:add_host).with("host:the-host")
  
        expect { invoke }.to write("Host added")
      end
    end
  end

  [ "layer hosts remove", "layer:hosts:remove" ].each do |cmd|
    describe_command "#{cmd} the-layer the-host" do
      it "adds a host to the layer" do
        expect_any_instance_of(Conjur::API).to receive(:layer).with("the-layer").and_return layer
        expect(layer).to receive(:remove_host).with("the-account:host:the-host")
  
        expect { invoke }.to write("Host removed")
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
conjur-cli-5.6.6 spec/command/layers_spec.rb
conjur-cli-5.6.5 spec/command/layers_spec.rb
conjur-cli-5.6.4 spec/command/layers_spec.rb
conjur-cli-5.6.3 spec/command/layers_spec.rb
conjur-cli-5.5.0 spec/command/layers_spec.rb
conjur-cli-5.4.0 spec/command/layers_spec.rb
conjur-cli-5.3.0 spec/command/layers_spec.rb
conjur-cli-5.2.5 spec/command/layers_spec.rb
conjur-cli-5.2.4 spec/command/layers_spec.rb
conjur-cli-5.2.3 spec/command/layers_spec.rb
conjur-cli-5.2.1 spec/command/layers_spec.rb
conjur-cli-5.2.0 spec/command/layers_spec.rb
conjur-cli-5.1.2 spec/command/layers_spec.rb
conjur-cli-5.1.1 spec/command/layers_spec.rb
conjur-cli-5.1.0 spec/command/layers_spec.rb
conjur-cli-4.30.1 spec/command/layers_spec.rb
conjur-cli-4.30.0 spec/command/layers_spec.rb
conjur-cli-4.29.0 spec/command/layers_spec.rb
conjur-cli-4.28.2 spec/command/layers_spec.rb
conjur-cli-4.28.1 spec/command/layers_spec.rb