aboutsummaryrefslogtreecommitdiffstats
path: root/formats/config/encoder_test.go
blob: 5335b83ff697d14e303443e02b82a7a112e66df4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package config

import (
	"bytes"

	. "gopkg.in/check.v1"
)

type EncoderSuite struct{}

var _ = Suite(&EncoderSuite{})

func (s *EncoderSuite) TestEncode(c *C) {
	for idx, fixture := range fixtures {
		buf := &bytes.Buffer{}
		e := NewEncoder(buf)
		err := e.Encode(fixture.Config)
		c.Assert(err, IsNil, Commentf("encoder error for fixture: %d", idx))
		c.Assert(buf.String(), Equals, fixture.Text, Commentf("bad result for fixture: %d", idx))
	}
}