✨ Config.AddOptions and Generator.MakeWithConfig
This commit is contained in:
parent
d7b14f804c
commit
1abfaa44d1
3 changed files with 25 additions and 3 deletions
|
|
@ -20,3 +20,12 @@ func TestNewConfWithOpts(t *testing.T) {
|
|||
assert.Equal(t, "", c.extension)
|
||||
assert.Equal(t, "foobar", c.prefix)
|
||||
}
|
||||
|
||||
func TestConfAddOpts(t *testing.T) {
|
||||
c := Config{original: "hi"}
|
||||
c2 := c.AddOptions(WithOriginalSlug("Hello, my dear"), WithPrefix("yo"))
|
||||
assert.Equal(t, "", c.prefix)
|
||||
assert.Equal(t, "hi", c.original)
|
||||
assert.Equal(t, "hello-my-dear", c2.original)
|
||||
assert.Equal(t, "yo", c2.prefix)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue