mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-23 15:31:26 +00:00
Enhancements to Revel command
Reformat of code Allow user to use a mix of command line arguments and flags Enhance the import tool to detect missing packages in the modules side Added test cases for all commands
This commit is contained in:
31
revel/test_test.go
Normal file
31
revel/test_test.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package main_test
|
||||
|
||||
import (
|
||||
"github.com/revel/cmd/model"
|
||||
"github.com/revel/cmd/revel"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
||||
// 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")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user