1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
package config
// TODO: renable these tests when vagrantfile's can be parsed in hcl
// import (
// "path/filepath"
// "testing"
// "github.com/stretchr/testify/require"
// )
//
// func TestConfigValidate(t *testing.T) {
// cases := []struct {
// File string
// Err string
// }{
// {
// "valid.hcl",
// "",
// },
// {
// "no_build.hcl",
// "'build' stanza",
// },
// }
// for _, tt := range cases {
// t.Run(tt.File, func(t *testing.T) {
// require := require.New(t)
// cfg, err := Load(filepath.Join("testdata", "validate", tt.File), "")
// require.NoError(err)
// err = cfg.Validate()
// if tt.Err == "" {
// require.NoError(err)
// return
// }
// require.Error(err)
// require.Contains(err.Error(), tt.Err)
// })
// }
// }
|