goldsmith/plugins/document/document_test.go

26 lines
454 B
Go
Raw Normal View History

2024-02-17 06:35:49 +00:00
package document
import (
"testing"
"git.foosoft.net/alex/goldsmith"
"git.foosoft.net/alex/goldsmith/harness"
"github.com/PuerkitoBio/goquery"
)
func process(file *goldsmith.File, doc *goquery.Document) error {
2024-02-17 06:35:49 +00:00
doc.Find("h1").SetAttr("style", "color: red;")
return nil
}
func Test(self *testing.T) {
type Processor func(*goquery.Document) error
harness.Validate(
self,
func(gs *goldsmith.Goldsmith) {
gs.Chain(New(process))
},
)
}