Sha256: a152a3cc774377c6dca5be1edda026d7435f129c0e478f57c157a5b9e51cf95d

Contents?: true

Size: 1.02 KB

Versions: 4

Compression:

Stored size: 1.02 KB

Contents

require 'kontena_cli'
require 'kontena/light_prompt'
require 'kontena/cli/whoami_command'

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

4 entries across 4 versions & 1 rubygems

Version Path
kontena-cli-1.2.0.pre3 spec/kontena/kontena_cli_spec.rb
kontena-cli-1.2.0.pre2 spec/kontena/kontena_cli_spec.rb
kontena-cli-1.2.0.pre1 spec/kontena/kontena_cli_spec.rb
kontena-cli-1.2.0.dev1 spec/kontena/kontena_cli_spec.rb