Permalink
Browse files

cmd: add test for reviewdog -version

  • Loading branch information...
1 parent 3f535fa commit 01ccab1fbdf52cd886434d046903f59940ef6b39 @haya14busa committed Dec 16, 2016
Showing with 10 additions and 0 deletions.
  1. +10 −0 cmd/reviewdog/main_test.go
@@ -461,3 +461,13 @@ func TestCommonci(t *testing.T) {
}
}
+
+func TestRun_version(t *testing.T) {
+ stdout := new(bytes.Buffer)
+ if err := run(nil, stdout, &option{version: true}); err != nil {
+ t.Error(err)
+ }
+ if got := strings.TrimRight(stdout.String(), "\n"); got != version {
+ t.Errorf("version = %v, want %v", got, version)
+ }
+}

0 comments on commit 01ccab1

Please sign in to comment.