Sha256: 4e3d5c2416fb3c14db92b86cea7985efecf8449fe815cce82d1cfa6d3b5199a7
Contents?: true
Size: 1005 Bytes
Versions: 20
Compression:
Stored size: 1005 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 exit_with_error.and output(/Could not resolve master by name 'not_existing'/).to_stderr end it 'should abort with error message if master is not given' do expect { subject.run([]) }.to raise_error Clamp::UsageError end it 'should clear current master when --clear given' do expect(subject.config).to receive(:write).and_return(true) subject.run(['--clear']) expect(subject.config.current_server).to be_nil end end end
Version data entries
20 entries across 20 versions & 1 rubygems