Sha256: 30c3c425121df2df8a925766cf9bf5091173e42b39b7e4ab3d9c86d24bb023cf

Contents?: true

Size: 741 Bytes

Versions: 69

Compression:

Stored size: 741 Bytes

Contents

require 'kontena/cli/master/current_command'

describe Kontena::Cli::Master::CurrentCommand do
  include ClientHelpers

  let(:subject) { described_class.new(File.basename($0)) }

  describe '#execute' do
    it 'puts master name and URL' do
      expect{subject.run([])}.to output(/alias.*someurl/).to_stdout
    end

    it 'only outputs name if name-flag is set' do
      expect{subject.run(['--name'])}.to output("alias\n").to_stdout
    end

    it 'does not raise error when logged in' do
      expect{subject.run([])}.not_to exit_with_error
    end

    it 'raises error when not logged in' do
      expect(subject.config).to receive(:current_master).and_return(nil)
      expect{subject.run([])}.to exit_with_error
    end
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
kontena-cli-1.5.4 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.5.4.rc1 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.5.3 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.5.2 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.5.1 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.5.0 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.5.0.rc1 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.5.0.pre5 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.5.0.pre4 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.5.0.pre3 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.5.0.pre2 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.5.0.pre1 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.4.3 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.4.3.rc1 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.4.2 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.4.2.rc1 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.4.2.pre1 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.4.1 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.4.1.rc1 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.4.1.pre1 spec/kontena/cli/master/current_command_spec.rb