This commit is contained in:
crapStone 2024-01-18 21:22:19 +01:00
parent 7b3a09d8ac
commit 4a6f56b44b
No known key found for this signature in database
GPG key ID: 22D4BF0CF7CC29C8
7 changed files with 54 additions and 34 deletions

View file

@ -48,13 +48,13 @@ func readTestConfig() (*Config, error) {
return nil, err
}
expectedConfig := &Config{}
err = toml.Unmarshal(content, expectedConfig)
expectedConfig := NewDefaultConfig()
err = toml.Unmarshal(content, &expectedConfig)
if err != nil {
return nil, err
}
return expectedConfig, nil
return &expectedConfig, nil
}
func TestReadConfigShouldReturnEmptyConfigWhenConfigArgEmpty(t *testing.T) {
@ -62,7 +62,8 @@ func TestReadConfigShouldReturnEmptyConfigWhenConfigArgEmpty(t *testing.T) {
t,
func(ctx *cli.Context) error {
cfg, err := ReadConfig(ctx)
assert.Equal(t, &Config{}, cfg)
expected := NewDefaultConfig()
assert.Equal(t, &expected, cfg)
return err
},