mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-11-03 20:17:59 +00:00 
			
		
		
		
	@mitchellh suggested we fork `cli` and switch to that. Since we primarily use the interfaces in `cli`, and the new fork has not changed those, this is (mostly) a drop-in replacement. A small fix will be necessary for Vault Enterprise, I believe.
		
			
				
	
	
		
			38 lines
		
	
	
		
			623 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			623 B
		
	
	
	
		
			Go
		
	
	
	
	
	
// Copyright (c) HashiCorp, Inc.
 | 
						|
// SPDX-License-Identifier: BUSL-1.1
 | 
						|
 | 
						|
package command
 | 
						|
 | 
						|
import (
 | 
						|
	"testing"
 | 
						|
 | 
						|
	"github.com/hashicorp/cli"
 | 
						|
 | 
						|
	"github.com/hashicorp/vault/command/token"
 | 
						|
)
 | 
						|
 | 
						|
func testAuthCommand(tb testing.TB) (*cli.MockUi, *AuthCommand) {
 | 
						|
	tb.Helper()
 | 
						|
 | 
						|
	ui := cli.NewMockUi()
 | 
						|
	return ui, &AuthCommand{
 | 
						|
		BaseCommand: &BaseCommand{
 | 
						|
			UI: ui,
 | 
						|
 | 
						|
			// Override to our own token helper
 | 
						|
			tokenHelper: token.NewTestingTokenHelper(),
 | 
						|
		},
 | 
						|
	}
 | 
						|
}
 | 
						|
 | 
						|
func TestAuthCommand_Run(t *testing.T) {
 | 
						|
	t.Parallel()
 | 
						|
 | 
						|
	t.Run("no_tabs", func(t *testing.T) {
 | 
						|
		t.Parallel()
 | 
						|
 | 
						|
		_, cmd := testAuthCommand(t)
 | 
						|
		assertNoTabs(t, cmd)
 | 
						|
	})
 | 
						|
}
 |