Sha256: 3493eca34636cfc9cb47787519335552456e869f176f33fe4d33fdd038f93410

Contents?: true

Size: 859 Bytes

Versions: 67

Compression:

Stored size: 859 Bytes

Contents

require_relative "../../../spec_helper"
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([])
      }.to_not raise_error
    end

    it 'raises error when not logged in' do
      expect(subject.config).to receive(:current_master).and_return(nil)

      expect {
        subject.run([])
      }.to raise_error(ArgumentError)
    end
  end
end

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
kontena-cli-1.1.6 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.1.5 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.1.5.rc3 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.1.5.rc2 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.1.5.rc1 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.1.4 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.1.3 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.1.2 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.1.2.rc2 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.1.2.rc1 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.1.1 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.1.1.rc1 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.1.0 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.1.0.rc2 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.1.0.rc1 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.1.0.pre1 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.0.6 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.0.6.rc1 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.0.5 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-1.0.5.rc1 spec/kontena/cli/master/current_command_spec.rb