mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-11 10:44:28 +00:00
32 lines
694 B
Go
32 lines
694 B
Go
package main_test
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/revel/cmd/model"
|
|
main "github.com/revel/cmd/revel"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
// test the commands.
|
|
func TestRevelTest(t *testing.T) {
|
|
a := assert.New(t)
|
|
gopath := setup("revel-test-test", a)
|
|
|
|
t.Run("Test", func(t *testing.T) {
|
|
a := assert.New(t)
|
|
c := newApp("test-test", model.NEW, nil, a)
|
|
a.Nil(main.Commands[model.NEW].RunWith(c), "Failed to run test-test")
|
|
c.Index = model.TEST
|
|
c.Test.ImportPath = c.ImportPath
|
|
a.Nil(main.Commands[model.TEST].RunWith(c), "Failed to run test-test")
|
|
})
|
|
|
|
if !t.Failed() {
|
|
if err := os.RemoveAll(gopath); err != nil {
|
|
a.Fail("Failed to remove test path")
|
|
}
|
|
}
|
|
}
|