Add the ability to fully customize jet generated files.
This commit is contained in:
parent
caa81930dc
commit
8864667f47
40 changed files with 2274 additions and 882 deletions
25
tests/internal/utils/file/file.go
Normal file
25
tests/internal/utils/file/file.go
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package file
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/require"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// Exists expects file to exist on path constructed from pathElems and returns content of the file
|
||||
func Exists(t *testing.T, pathElems ...string) (fileContent string) {
|
||||
modelFilePath := path.Join(pathElems...)
|
||||
file, err := ioutil.ReadFile(modelFilePath)
|
||||
require.Nil(t, err)
|
||||
require.NotEmpty(t, file)
|
||||
return string(file)
|
||||
}
|
||||
|
||||
// NotExists expects file not to exist on path constructed from pathElems
|
||||
func NotExists(t *testing.T, pathElems ...string) {
|
||||
modelFilePath := path.Join(pathElems...)
|
||||
_, err := ioutil.ReadFile(modelFilePath)
|
||||
require.True(t, os.IsNotExist(err))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue