-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Go templates support, XML, JSON, Ingress (#49)
- Loading branch information
1 parent
f75bf15
commit bed576f
Showing
76 changed files
with
2,184 additions
and
970 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
/.vscode | ||
|
||
## Binaries | ||
error-pages | ||
/error-pages | ||
|
||
## Temp dirs & trash | ||
/temp | ||
|
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,41 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"github.com/kami-zh/go-capturer" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func Test_Main(t *testing.T) { | ||
os.Args = []string{"", "--help"} | ||
exitFn = func(code int) { assert.Equal(t, 0, code) } | ||
|
||
output := capturer.CaptureStdout(main) | ||
|
||
assert.Contains(t, output, "Usage:") | ||
assert.Contains(t, output, "Available Commands:") | ||
assert.Contains(t, output, "Flags:") | ||
} | ||
|
||
func Test_MainWithoutCommands(t *testing.T) { | ||
os.Args = []string{""} | ||
exitFn = func(code int) { assert.Equal(t, 0, code) } | ||
|
||
output := capturer.CaptureStdout(main) | ||
|
||
assert.Contains(t, output, "Usage:") | ||
assert.Contains(t, output, "Available Commands:") | ||
assert.Contains(t, output, "Flags:") | ||
} | ||
|
||
func Test_MainUnknownSubcommand(t *testing.T) { | ||
os.Args = []string{"", "foobar"} | ||
exitFn = func(code int) { assert.Equal(t, 1, code) } | ||
|
||
output := capturer.CaptureStderr(main) | ||
|
||
assert.Contains(t, output, "unknown command") | ||
assert.Contains(t, output, "foobar") | ||
} |
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
Oops, something went wrong.