Skip to content

Commit

Permalink
Merge pull request #226 from motemen/test
Browse files Browse the repository at this point in the history
add tests for package cmdutil
  • Loading branch information
Songmu committed Dec 19, 2019
2 parents 1cfb0dc + 5f92f06 commit 3b2615e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions cmdutil/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,25 @@ func TestRunInDirSilently(t *testing.T) {
if !strings.HasPrefix(fmt.Sprintf("%s", err), expect) {
t.Errorf("error message should have prefix %q, but: %q", expect, err)
}
}

func TestRun(t *testing.T) {
err := Run("echo")
if err != nil {
t.Errorf("error should be nil but: %s", err)
}
}

func TestRunInDir(t *testing.T) {
err := RunInDir(".", "echo")
if err != nil {
t.Errorf("error should be nil but: %s", err)
}
}

func TestRunSilently(t *testing.T) {
err := RunSilently("echo")
if err != nil {
t.Errorf("error should be nil but: %s", err)
}
}

0 comments on commit 3b2615e

Please sign in to comment.