2016-11-21 18:34:50 -05:00
|
|
|
package fix
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
2018-09-06 14:55:11 -04:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2016-11-21 18:34:50 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestFixerManifestPPFilename_Impl(t *testing.T) {
|
|
|
|
var _ Fixer = new(FixerVagrantPPOverride)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestFixerManifestPPFilename_Fix(t *testing.T) {
|
|
|
|
var f FixerManifestFilename
|
|
|
|
|
|
|
|
input := map[string]interface{}{
|
2016-11-21 18:35:57 -05:00
|
|
|
"post-processors": []interface{}{
|
|
|
|
map[string]interface{}{
|
2016-11-21 18:34:50 -05:00
|
|
|
"type": "manifest",
|
|
|
|
"filename": "foo",
|
|
|
|
},
|
2016-11-21 18:35:57 -05:00
|
|
|
[]interface{}{
|
|
|
|
map[string]interface{}{
|
|
|
|
"type": "manifest",
|
|
|
|
"filename": "foo",
|
|
|
|
},
|
|
|
|
},
|
2016-11-21 18:34:50 -05:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
expected := map[string]interface{}{
|
2016-11-21 18:35:57 -05:00
|
|
|
"post-processors": []interface{}{
|
|
|
|
map[string]interface{}{
|
2016-11-21 18:34:50 -05:00
|
|
|
"type": "manifest",
|
|
|
|
"output": "foo",
|
|
|
|
},
|
2016-11-21 18:35:57 -05:00
|
|
|
[]interface{}{
|
|
|
|
map[string]interface{}{
|
|
|
|
"type": "manifest",
|
|
|
|
"output": "foo",
|
|
|
|
},
|
|
|
|
},
|
2016-11-21 18:34:50 -05:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
output, err := f.Fix(input)
|
2018-09-06 14:55:11 -04:00
|
|
|
assert.NoError(t, err)
|
2016-11-21 18:34:50 -05:00
|
|
|
|
2018-09-06 14:55:11 -04:00
|
|
|
assert.Equal(t, expected, output)
|
2016-11-21 18:34:50 -05:00
|
|
|
}
|