Sha256: 8399c2db75510fa45c38de5aa169050811589bd4f61ff6499a7226e134867b5f

Contents?: true

Size: 1.02 KB

Versions: 6

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Travis::CLI::Whoami do
  example 'travis whoami' do
    run_cli('whoami').should_not be_success
    stdout.should be_empty
    stderr.should be == "not logged in, please run #{File.basename $PROGRAM_NAME} login\n"
  end

  example 'travis whoami --pro' do
    run_cli('whoami', '--pro').should_not be_success
    stdout.should be_empty
    stderr.should be == "not logged in, please run #{File.basename $PROGRAM_NAME} login\n"
  end

  example 'travis whoami -t token' do
    run_cli('whoami', '-t', 'token').should be_success
    stdout.should be == "rkh\n"
    stderr.should be_empty
  end

  example 'TRAVIS_TOKEN=token travis whoami' do
    ENV['TRAVIS_TOKEN'] = 'token'
    run_cli('whoami').should be_success
    stdout.should be == "rkh\n"
    stderr.should be_empty
  end

  example 'travis whoami -t token -i' do
    run_cli('whoami', '-t', 'token', '-i').should be_success
    stdout.should be == "You are rkh (Konstantin Haase)\n"
    stderr.should be_empty
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
travis-1.14.0 spec/cli/whoami_spec.rb
travis-1.13.3 spec/cli/whoami_spec.rb
travis-1.13.2 spec/cli/whoami_spec.rb
travis-1.13.1 spec/cli/whoami_spec.rb
travis-1.13.0 spec/cli/whoami_spec.rb
travis-1.12.0 spec/cli/whoami_spec.rb