1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-02-05 13:15:26 +02:00
This commit is contained in:
Carlos Alexandro Becker 2017-08-02 09:16:59 -03:00
parent 377b800c9b
commit 55fdb249f8
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
2 changed files with 20 additions and 23 deletions

View File

@ -179,11 +179,11 @@ func LoadReader(fd io.Reader) (config Project, err error) {
if err != nil {
return config, err
}
err = yaml.Unmarshal(data, &config)
if err := yaml.Unmarshal(data, &config); err != nil {
return config, err
}
log.WithField("config", config).Debug("loaded config file")
err = checkOverflows(config)
return
return config, checkOverflows(config)
}
func checkOverflows(config Project) error {

View File

@ -15,28 +15,25 @@ func TestDescription(t *testing.T) {
assert.NotEmpty(t, Pipe{}.Description())
}
func TestRunPipeNoSummary(t *testing.T) {
var assert = assert.New(t)
var ctx = &context.Context{
Config: config.Project{
Snapcraft: config.Snapcraft{
Description: "dummy",
},
func TestRunPipeMissingInfo(t *testing.T) {
for name, snap := range map[string]config.Snapcraft{
"missing summary": config.Snapcraft{
Description: "dummy desc",
},
}
assert.NoError(Pipe{}.Run(ctx))
}
func TestRunPipeNoDescription(t *testing.T) {
var assert = assert.New(t)
var ctx = &context.Context{
Config: config.Project{
Snapcraft: config.Snapcraft{
Summary: "dummy",
},
"missing description": config.Snapcraft{
Summary: "dummy summary",
},
} {
t.Run(name, func(t *testing.T) {
var assert = assert.New(t)
var ctx = &context.Context{
Config: config.Project{
Snapcraft: snap,
},
}
assert.NoError(Pipe{}.Run(ctx))
})
}
assert.NoError(Pipe{}.Run(ctx))
}
func TestRunPipe(t *testing.T) {