Sha256: 5ea6d5379c417f0920cb6239be9bfd979acaa5fc096b6e23a88099a443fa5cfc
Contents?: true
Size: 1.16 KB
Versions: 29
Compression:
Stored size: 1.16 KB
Contents
require_relative "../../../spec_helper" require 'kontena/cli/master/use_command' describe Kontena::Cli::Master::UseCommand do let(:subject) do described_class.new(File.basename($0)) end let(:client) { spy(:client) } let(:valid_settings) do {'current_server' => 'alias', 'servers' => [ {'name' => 'some_master', 'url' => 'some_master'}, {'name' => 'alias', 'url' => 'someurl', 'token' => '123456'} ] } end describe '#use' do it 'should update current master' do allow(subject).to receive(:client).and_return(client) allow(subject).to receive(:settings).and_return(valid_settings) expect(subject).to receive(:current_master=).with('some_master') subject.run(['some_master']) end it 'should fetch grid list from master' do allow(subject).to receive(:require_token).and_return('token') allow(subject).to receive(:client).and_return(client) allow(subject).to receive(:settings).and_return(valid_settings) expect(subject).to receive(:current_master=).with('some_master') expect(client).to receive(:get).with('grids') subject.run(['some_master']) end end end
Version data entries
29 entries across 29 versions & 1 rubygems