cmd/jb: Create integration tests for init and install

This commit is contained in:
Matthias Loibl 2019-04-24 18:21:41 +02:00
parent f71ef86d48
commit d95948a351
No known key found for this signature in database
GPG key ID: 78A796CA74CA38BA
2 changed files with 95 additions and 0 deletions

22
cmd/jb/init_test.go Normal file
View file

@ -0,0 +1,22 @@
// +build integration
package main
import (
"io/ioutil"
"os"
"testing"
"github.com/stretchr/testify/assert"
)
func TestInitCommand(t *testing.T) {
tempDir, err := ioutil.TempDir("", "jb-init")
if err != nil {
t.Fatal(err)
}
defer os.Remove(tempDir)
code := initCommand(tempDir)
assert.Equal(t, 0, code)
}