✨ Load config from file with defaults
This commit is contained in:
parent
2da9fcac37
commit
40f9518611
8 changed files with 127 additions and 2 deletions
18
config/default_test.go
Normal file
18
config/default_test.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"os"
|
||||
fp "path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestDefaultConfig(t *testing.T) {
|
||||
home, _ := os.UserHomeDir()
|
||||
inDir := fp.Join(home, "my-log")
|
||||
c, err := DefaultConfig()
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, inDir, c.Input.Path)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue