summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/spf13/cobra/doc/md_docs_test.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2017-04-24 20:11:36 -0400
committerJoram Wilander <jwawilander@gmail.com>2017-04-24 20:11:36 -0400
commitf5437632f486b7d0a0a181c58f113c86d032b02c (patch)
tree407388e3003a210a89f4b2128d7ad656f8b79d26 /vendor/github.com/spf13/cobra/doc/md_docs_test.go
parent7f68a60f8c228d5604e0566bf84cabb145d16c37 (diff)
downloadchat-f5437632f486b7d0a0a181c58f113c86d032b02c.tar.gz
chat-f5437632f486b7d0a0a181c58f113c86d032b02c.tar.bz2
chat-f5437632f486b7d0a0a181c58f113c86d032b02c.zip
Upgrading server dependancies (#6215)
Diffstat (limited to 'vendor/github.com/spf13/cobra/doc/md_docs_test.go')
-rw-r--r--vendor/github.com/spf13/cobra/doc/md_docs_test.go27
1 files changed, 23 insertions, 4 deletions
diff --git a/vendor/github.com/spf13/cobra/doc/md_docs_test.go b/vendor/github.com/spf13/cobra/doc/md_docs_test.go
index 86ee02930..f4f3bc149 100644
--- a/vendor/github.com/spf13/cobra/doc/md_docs_test.go
+++ b/vendor/github.com/spf13/cobra/doc/md_docs_test.go
@@ -2,14 +2,14 @@ package doc
import (
"bytes"
- "fmt"
+ "io/ioutil"
"os"
+ "path/filepath"
"strings"
"testing"
-)
-var _ = fmt.Println
-var _ = os.Stderr
+ "github.com/spf13/cobra"
+)
func TestGenMdDoc(t *testing.T) {
c := initializeWithRootCmd()
@@ -86,3 +86,22 @@ func TestGenMdNoTag(t *testing.T) {
checkStringOmits(t, found, unexpected)
}
+
+func TestGenMdTree(t *testing.T) {
+ cmd := &cobra.Command{
+ Use: "do [OPTIONS] arg1 arg2",
+ }
+ tmpdir, err := ioutil.TempDir("", "test-gen-md-tree")
+ if err != nil {
+ t.Fatalf("Failed to create tmpdir: %s", err.Error())
+ }
+ defer os.RemoveAll(tmpdir)
+
+ if err := GenMarkdownTree(cmd, tmpdir); err != nil {
+ t.Fatalf("GenMarkdownTree failed: %s", err.Error())
+ }
+
+ if _, err := os.Stat(filepath.Join(tmpdir, "do.md")); err != nil {
+ t.Fatalf("Expected file 'do.md' to exist")
+ }
+}