Sha256: a6a42ffda3755083f87c49f71d09ab18543c570f35f538cfefde228a3907c630

Contents?: true

Size: 624 Bytes

Versions: 13

Compression:

Stored size: 624 Bytes

Contents

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 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").and_return('trusted_subnets' => [
          '192.168.0.1/24',
      ])
      expect{subject.run(['test-grid'])}.to output("192.168.0.1/24\n").to_stdout
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
kontena-cli-1.2.2 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.2.2.rc2 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.2.2.rc1 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.2.1 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.2.1.rc1 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.2.0 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.2.0.rc3 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.2.0.rc2 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.2.0.rc1 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.2.0.pre3 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.2.0.pre2 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.2.0.pre1 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
kontena-cli-1.2.0.dev1 spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb