-
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.
feat: inputs/outputs in flow and test harness (#14)
* lots of moving stuff around cleanup/refactor * functioning commit - input/output processing looks to work * added functioning regex match input/output * test cases proving positional * refactor: moved things to interface impl for testing * test: updated test harness with ability to start testing * chore: moved mocks around * fix: corrected lint
- Loading branch information
1 parent
b2856ef
commit 55e9890
Showing
31 changed files
with
899 additions
and
201 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package cmd | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
|
||
"clingy/internal" | ||
) | ||
|
||
func TestRootCmdExecuteInstantiation(t *testing.T) { | ||
mockTools := internal.GenerateMockInterfacesForClingy(t) | ||
defer mockTools.Ctrl.Finish() | ||
|
||
cmd := RootCmd(&RootConfig{Magick: mockTools.MagickClientImpl}) | ||
output := internal.ExecCobraCmdAndReturnString(t, cmd, []string{}) | ||
assert.Contains(t, output, "clingy is a tool to test and capture CLI flows") | ||
} | ||
|
||
func TestRootCmdExecuteHelp(t *testing.T) { | ||
mockTools := internal.GenerateMockInterfacesForClingy(t) | ||
defer mockTools.Ctrl.Finish() | ||
|
||
cmd := RootCmd(&RootConfig{Magick: mockTools.MagickClientImpl}) | ||
output := internal.ExecCobraCmdAndReturnString(t, cmd, []string{"--help"}) | ||
assert.Contains(t, output, "clingy is a tool to test and capture CLI flows") | ||
} |
Oops, something went wrong.