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-0.16.0.pre7 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-0.16.0.pre6 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-0.16.0.pre5 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-0.16.0.pre4 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-0.16.0.pre3 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-0.16.0.pre2 spec/kontena/cli/master/current_command_spec.rb
kontena-cli-0.16.0.pre1 spec/kontena/cli/master/current_command_spec.rb