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-4.28.0 spec/command/layers_spec.rb
conjur-cli-4.27.0 spec/command/layers_spec.rb
conjur-cli-4.26.0 spec/command/layers_spec.rb
conjur-cli-4.25.2 spec/command/layers_spec.rb
conjur-cli-4.25.1 spec/command/layers_spec.rb
conjur-cli-4.25.0 spec/command/layers_spec.rb
conjur-cli-4.24.0 spec/command/layers_spec.rb
conjur-cli-4.23.0 spec/command/layers_spec.rb
conjur-cli-4.22.0 spec/command/layers_spec.rb
conjur-cli-4.21.1 spec/command/layers_spec.rb
conjur-cli-4.21.0 spec/command/layers_spec.rb
conjur-cli-4.20.1 spec/command/layers_spec.rb
conjur-cli-4.19.0 spec/command/layers_spec.rb
conjur-cli-4.18.6 spec/command/layers_spec.rb
conjur-cli-4.18.0 spec/command/layers_spec.rb
conjur-cli-4.17.0 spec/command/layers_spec.rb
conjur-cli-4.16.0 spec/command/layers_spec.rb
conjur-cli-4.15.0 spec/command/layers_spec.rb