run previously useless test

This commit is contained in:
Pavel 2019-10-25 13:30:24 +03:00
parent f9c4a5d462
commit cd50039247

View File

@ -1,11 +1,15 @@
package core
import (
"fmt"
"io/ioutil"
"log"
"math/rand"
"os"
"path"
"strings"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
@ -20,6 +24,15 @@ func (s *MigrationGeneratorSuite) SetupSuite() {
s.command = &NewMigrationCommand{Directory: "/tmp"}
}
func (s *MigrationGeneratorSuite) Test_FileExists() {
var (
seededRand *rand.Rand = rand.New(rand.NewSource(time.Now().UnixNano()))
notExist = fmt.Sprintf("/tmp/%d", seededRand.Int31())
)
assert.False(s.T(), s.command.FileExists(notExist))
}
func (s *MigrationGeneratorSuite) Test_Execute() {
found := false
assert.NoError(s.T(), s.command.Execute([]string{}))
@ -37,3 +50,7 @@ func (s *MigrationGeneratorSuite) Test_Execute() {
assert.True(s.T(), found)
}
func Test_MigrationGenerator(t *testing.T) {
suite.Run(t, new(MigrationGeneratorSuite))
}