Sha256: 3fd40d9963b0016aa2b05d8314363265571e9fb6ef552076dd759dbcb2dae666

Contents?: true

Size: 1.01 KB

Versions: 11

Compression:

Stored size: 1.01 KB

Contents

require_relative '../spec_helper'
require 'kontena_cli'
require 'kontena/light_prompt'

describe Kontena do
  context 'prompt' do
    before(:each) do
      Kontena.reset_prompt
    end

    after(:each) do
      Kontena.reset_prompt
    end

    it 'uses light prompt on windows' do
      allow(ENV).to receive(:[]).with('OS').and_return('Windows_NT')
      expect(Kontena.prompt).to be_kind_of(Kontena::LightPrompt)
    end
  end

  describe '#run' do
    let(:whoami) { double(:whoami) }

    before(:each) do
      expect(Kontena::Cli::WhoamiCommand).to receive(:new).and_return(whoami)
      expect(whoami).to receive(:run).with(['--bash-completion-path']).and_return(true)
    end

    it 'accepts a command line as string' do
      Kontena.run('whoami --bash-completion-path')
    end

    it 'accepts a command line as a list of parameters' do
      Kontena.run('whoami', '--bash-completion-path')
    end

    it 'accepts a command line as an array' do
      Kontena.run(['whoami', '--bash-completion-path'])
    end
  end
end



Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
kontena-cli-1.1.6 spec/kontena/kontena_cli_spec.rb
kontena-cli-1.1.5 spec/kontena/kontena_cli_spec.rb
kontena-cli-1.1.5.rc3 spec/kontena/kontena_cli_spec.rb
kontena-cli-1.1.5.rc2 spec/kontena/kontena_cli_spec.rb
kontena-cli-1.1.5.rc1 spec/kontena/kontena_cli_spec.rb
kontena-cli-1.1.4 spec/kontena/kontena_cli_spec.rb
kontena-cli-1.1.3 spec/kontena/kontena_cli_spec.rb
kontena-cli-1.1.2 spec/kontena/kontena_cli_spec.rb
kontena-cli-1.1.2.rc2 spec/kontena/kontena_cli_spec.rb
kontena-cli-1.1.2.rc1 spec/kontena/kontena_cli_spec.rb
kontena-cli-1.1.1 spec/kontena/kontena_cli_spec.rb