mirror of
https://github.com/MontFerret/ferret.git
synced 2024-12-14 11:23:02 +02:00
27 lines
647 B
Go
27 lines
647 B
Go
package drivers_test
|
|
|
|
import (
|
|
"github.com/MontFerret/ferret/pkg/drivers"
|
|
"testing"
|
|
|
|
. "github.com/smartystreets/goconvey/convey"
|
|
)
|
|
|
|
func TestHTTPHeader(t *testing.T) {
|
|
Convey("HTTPHeader", t, func() {
|
|
Convey(".MarshalJSON", func() {
|
|
Convey("Should serialize header values", func() {
|
|
headers := make(drivers.HTTPHeader)
|
|
|
|
headers["content-encoding"] = []string{"gzip"}
|
|
headers["content-type"] = []string{"text/html", "charset=utf-8"}
|
|
|
|
out, err := headers.MarshalJSON()
|
|
|
|
So(err, ShouldBeNil)
|
|
So(string(out), ShouldEqual, `{"content-encoding":["gzip"],"content-type":["text/html","charset=utf-8"]}`)
|
|
})
|
|
})
|
|
})
|
|
}
|