♻️ Export Config
This commit is contained in:
parent
5c4e66d144
commit
7bd5503613
6 changed files with 56 additions and 38 deletions
22
config_test.go
Normal file
22
config_test.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package nomino
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestNewConf(t *testing.T) {
|
||||
c := NewConfig()
|
||||
assert.Equal(t, ".txt", c.extension)
|
||||
st, _ := c.generator()
|
||||
_, parseErr := uuid.Parse(st)
|
||||
assert.NoError(t, parseErr)
|
||||
}
|
||||
|
||||
func TestNewConfWithOpts(t *testing.T) {
|
||||
c := NewConfig(WithoutExtension(), WithPrefix("foobar"))
|
||||
assert.Equal(t, "", c.extension)
|
||||
assert.Equal(t, "foobar_", c.prefix)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue