Sha256: b768cbc96b0c523d49be754b0e09f621a6b4adfb43ff12dbd51ce5716870e87d

Contents?: true

Size: 628 Bytes

Versions: 16

Compression:

Stored size: 628 Bytes

Contents

require 'kontena/cli/master/use_command'

describe Kontena::Cli::Master::UseCommand do

  include ClientHelpers

  let(:subject) do
    described_class.new(File.basename($0))
  end

  describe '#use' do
    it 'should update current master' do
      expect(subject.config).to receive(:write).and_return(true)
      subject.run(['some_master'])
      expect(subject.config.current_server).to eq 'some_master'
    end

    it 'should abort with error message if master is not configured' do
      expect { subject.run(['not_existing']) }.to output(/Could not resolve master with name: 'not_existing'/).to_stderr
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
kontena-cli-1.3.0.rc1 spec/kontena/cli/master/use_command_spec.rb
kontena-cli-1.3.0.pre2 spec/kontena/cli/master/use_command_spec.rb
kontena-cli-1.3.0.pre1 spec/kontena/cli/master/use_command_spec.rb
kontena-cli-1.2.2 spec/kontena/cli/master/use_command_spec.rb
kontena-cli-1.2.2.rc2 spec/kontena/cli/master/use_command_spec.rb
kontena-cli-1.2.2.rc1 spec/kontena/cli/master/use_command_spec.rb
kontena-cli-1.2.1 spec/kontena/cli/master/use_command_spec.rb
kontena-cli-1.2.1.rc1 spec/kontena/cli/master/use_command_spec.rb
kontena-cli-1.2.0 spec/kontena/cli/master/use_command_spec.rb
kontena-cli-1.2.0.rc3 spec/kontena/cli/master/use_command_spec.rb
kontena-cli-1.2.0.rc2 spec/kontena/cli/master/use_command_spec.rb
kontena-cli-1.2.0.rc1 spec/kontena/cli/master/use_command_spec.rb
kontena-cli-1.2.0.pre3 spec/kontena/cli/master/use_command_spec.rb
kontena-cli-1.2.0.pre2 spec/kontena/cli/master/use_command_spec.rb
kontena-cli-1.2.0.pre1 spec/kontena/cli/master/use_command_spec.rb
kontena-cli-1.2.0.dev1 spec/kontena/cli/master/use_command_spec.rb