🚧 Pass Config to generator
This commit is contained in:
parent
67f472a2c6
commit
921020d9fd
6 changed files with 31 additions and 31 deletions
|
|
@ -8,7 +8,7 @@ import (
|
|||
)
|
||||
|
||||
func TestMake(t *testing.T) {
|
||||
genOpt := WithGenerator(func() (string, error) { return "abc", nil })
|
||||
genOpt := WithGenerator(func(*Config) (string, error) { return "abc", nil })
|
||||
testcases := []struct {
|
||||
name string
|
||||
opts []Option
|
||||
|
|
@ -47,7 +47,7 @@ func TestMake(t *testing.T) {
|
|||
|
||||
func TestMakeErr(t *testing.T) {
|
||||
retErr := errors.New("oops")
|
||||
conf := NewConfig(WithGenerator(func() (string, error) { return "foobar", retErr }))
|
||||
conf := NewConfig(WithGenerator(func(*Config) (string, error) { return "foobar", retErr }))
|
||||
st, err := Make(conf)
|
||||
assert.Zero(t, st)
|
||||
assert.ErrorIs(t, err, retErr)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue