aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/config/encoder_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/format/config/encoder_test.go')
-rw-r--r--plumbing/format/config/encoder_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/plumbing/format/config/encoder_test.go b/plumbing/format/config/encoder_test.go
new file mode 100644
index 0000000..5335b83
--- /dev/null
+++ b/plumbing/format/config/encoder_test.go
@@ -0,0 +1,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))
+ }
+}