Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor learn markdown subcommands into Cobra Commands with tests (#128
) * Refactor learn markdown subcommands into Cobra Commands with tests NOTE: This refactor leaves the entire CLI usage exactly the same. The only difference is that the help messages for learn markdown are much more thorough. This refactor moves all learn markdown commands into their own files and Cobra Commands. The common flags for all markdown commands are put into the PersistentFlags of the markdown command object. Those flags are then accessible to all child commands. The newly-implemented flags for questions/challenges are now only defined for the markdown subcommands in the "questions" group. The markdown subcommand-specific help messages now contain the same introductory text that can be found in the Learn Documentation cohort. (https://learn-2.galvanize.com/cohorts/667) The orthogonal interest of how to write output to a destination (clipboard, stdout, append) has also been refactored into its own package (templates). This allows for independent testing of the methods of writing. The refactor necessitated the upgrade of the Cobra library to the most recent version. Because of this refactor, it is now possible to test markdown subcommands in isolation, not only their configuration, but also the way the execute. This has allowed for nearly 100% coverage of all Markdown-related code in the CLI. * Bump the Go version in tests for gomock. * Move clipboard test to integration test * Address error in descyaml generator The description.yaml file needs UID replacement. This commit addresses that. [x] Unit test created to demonstrate the problem [x] YAML command parameter added to indicate the need of a UID [x] `createYamlCommand` updated to use the new flag [x] New flag explicitly set in all YAML commands --------- Co-authored-by: Curtis Schlak <156-curtis@users.noreply.gitlab.galvanize.com>
- Loading branch information