goldsmith/plugins/forward/forward_test.go
2024-02-16 22:35:49 -08:00

33 lines
642 B
Go

package forward
import (
"testing"
"git.foosoft.net/alex/goldsmith"
"git.foosoft.net/alex/goldsmith/filters/operator"
"git.foosoft.net/alex/goldsmith/filters/wildcard"
"git.foosoft.net/alex/goldsmith/harness"
"git.foosoft.net/alex/goldsmith/plugins/layout"
)
func Test(self *testing.T) {
meta := map[string]interface{}{
"Layout": "forward",
}
pathMap := map[string]string{
"file_old.html": "file_new.html",
}
harness.Validate(
self,
func(gs *goldsmith.Goldsmith) {
gs.
FilterPush(operator.Not(wildcard.New("*.gohtml"))).
Chain(New(meta).PathMap(pathMap)).
FilterPop().
Chain(layout.New())
},
)
}