-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CUS-384: fix -store flag, make test less fake-reliant (#40)
In #37, we thought App.Before was called after subcommand flag parsing, but it is not. This meant the -store flag did not work. We need the flags to be parsed before we construct the object graph in appState.build. Instead, call appState.build from the Command.Before hook. Our tests in main_test.go should have caught this, but they fake appState.tokenStore so the -store flag is ignored. This PR now makes the test use the real LoadStorer implementations in most cases, but calls keyring.MockInit ahead of time and uses a temporary user configuration directory to avoid side effects.
- Loading branch information
Showing
3 changed files
with
29 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters