Sha256: d331cea1f31b0ae0fcecc25c11ef18cfca1350237d18f18ba96aeacf46829927

Contents?: true

Size: 801 Bytes

Versions: 95

Compression:

Stored size: 801 Bytes

Contents

require_relative "../../../../spec_helper"
require "kontena/cli/grids/trusted_subnet_command"
require "kontena/cli/grids/trusted_subnets/list_command"

describe Kontena::Cli::Grids::TrustedSubnets::ListCommand do

  include ClientHelpers

  describe '#execute' do
    it 'requires api url' do
      expect(subject).to receive(:require_api_url).once
      subject.run(['grid'])
    end

    it 'requires token' do
      expect(subject).to receive(:require_token).and_return(token)
      subject.run(['grid'])
    end

    it 'requires grid as param' do
      expect {
        subject.run([])
      }.to raise_error(Clamp::UsageError)
    end

    it 'requests grid details from master' do
      expect(client).to receive(:get).with("grids/test-grid")
      subject.run(['test-grid'])
    end
  end
end

Version data entries

95 entries across 95 versions & 1 rubygems

Version Path
kontena-cli-1.1.6 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.1.5 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.1.5.rc3 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.1.5.rc2 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.1.5.rc1 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.1.4 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.1.3 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.1.2 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.1.2.rc2 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.1.2.rc1 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.1.1 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.1.1.rc1 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.1.0 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.1.0.rc2 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.1.0.rc1 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.1.0.pre1 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.0.6 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.0.6.rc1 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.0.5 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.0.5.rc1 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb