Files
openrtb/openrtb3/openrtb3_test.go
T
mxmCherry 3855899d4b v14: fix go module
https://blog.golang.org/v2-go-modules

Roughly, just a:

```shell
find -type f -iname '*.go' | xargs -I {} sed -i 's/mxmCherry\/openrtb/mxmCherry\/openrtb\/v14/g' {}
find -type f -iname '*.go' | xargs -I {} goimports -w {}
```

Also, point to pkg.go.dev for documentation (old godoc.org badge kept kill pkg.go.dev provides its own).
2020-03-01 15:05:53 +02:00

32 lines
612 B
Go

package openrtb3_test
import (
"encoding/json"
"io/ioutil"
"path/filepath"
. "github.com/mxmCherry/openrtb/v14/openrtb3"
. "github.com/onsi/ginkgo/extensions/table"
. "github.com/onsi/gomega"
)
var _ = DescribeTable(
"Marshaling",
func(file string) {
golden, err := ioutil.ReadFile(filepath.Join("testdata", file))
Expect(err).NotTo(HaveOccurred())
v := new(Body)
Expect(json.Unmarshal(golden, v)).To(Succeed())
b, err := json.Marshal(v)
Expect(err).NotTo(HaveOccurred())
Expect(b).To(MatchJSON(golden))
},
Entry("request", "request.json"),
Entry("response", "response.json"),
)