2017-05-11 04:34:47 +02:00
|
|
|
package config
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
2017-05-11 04:35:44 +02:00
|
|
|
"testing"
|
2017-05-11 04:34:47 +02:00
|
|
|
|
2017-05-11 04:35:44 +02:00
|
|
|
"github.com/stretchr/testify/assert"
|
2017-05-11 04:34:47 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestRepo(t *testing.T) {
|
|
|
|
var assert = assert.New(t)
|
|
|
|
r := Repo{"goreleaser", "godownloader"}
|
|
|
|
assert.Equal("goreleaser/godownloader", r.String(), "not equal")
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestLoadReader(t *testing.T) {
|
2017-05-11 04:35:44 +02:00
|
|
|
var conf = `
|
2017-05-11 04:34:47 +02:00
|
|
|
homepage: &homepage http://goreleaser.github.io
|
|
|
|
fpm:
|
|
|
|
homepage: *homepage
|
|
|
|
`
|
2017-05-11 04:35:44 +02:00
|
|
|
var assert = assert.New(t)
|
2017-05-11 04:34:47 +02:00
|
|
|
buf := strings.NewReader(conf)
|
|
|
|
prop, err := LoadReader(buf)
|
|
|
|
|
|
|
|
assert.Nil(err)
|
|
|
|
assert.Equal("http://goreleaser.github.io", prop.FPM.Homepage, "yaml did not load correctly")
|
|
|
|
}
|