aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/protocol/packp/report_status_test.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2016-12-19 23:36:44 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2016-12-19 23:36:44 +0100
commit90d67bb648ae32d5b1a0f7b1af011da6dfb24315 (patch)
treefc8c14e82974be6ff49e842328ec3206ebf1b4c2 /plumbing/protocol/packp/report_status_test.go
parent725ade0de6f60549e65cc4d94094b1f5ed48587f (diff)
downloadgo-git-90d67bb648ae32d5b1a0f7b1af011da6dfb24315.tar.gz
remote: add Push (#178)
* remote: add Push. * add Push method to Remote. * add method Push to Repository. * examples: add push example. * requested changes * add tests, fixes
Diffstat (limited to 'plumbing/protocol/packp/report_status_test.go')
-rw-r--r--plumbing/protocol/packp/report_status_test.go19
1 files changed, 11 insertions, 8 deletions
diff --git a/plumbing/protocol/packp/report_status_test.go b/plumbing/protocol/packp/report_status_test.go
index 168d25b..1c3fa81 100644
--- a/plumbing/protocol/packp/report_status_test.go
+++ b/plumbing/protocol/packp/report_status_test.go
@@ -13,22 +13,25 @@ type ReportStatusSuite struct{}
var _ = Suite(&ReportStatusSuite{})
-func (s *ReportStatusSuite) TestOk(c *C) {
+func (s *ReportStatusSuite) TestError(c *C) {
rs := NewReportStatus()
rs.UnpackStatus = "ok"
- c.Assert(rs.Ok(), Equals, true)
+ c.Assert(rs.Error(), IsNil)
rs.UnpackStatus = "OK"
- c.Assert(rs.Ok(), Equals, false)
+ c.Assert(rs.Error(), ErrorMatches, "unpack error: OK")
rs.UnpackStatus = ""
- c.Assert(rs.Ok(), Equals, false)
+ c.Assert(rs.Error(), ErrorMatches, "unpack error: ")
+
+ cs := &CommandStatus{ReferenceName: plumbing.ReferenceName("ref")}
+ rs.UnpackStatus = "ok"
+ rs.CommandStatuses = append(rs.CommandStatuses, cs)
- cs := &CommandStatus{}
cs.Status = "ok"
- c.Assert(cs.Ok(), Equals, true)
+ c.Assert(rs.Error(), IsNil)
cs.Status = "OK"
- c.Assert(cs.Ok(), Equals, false)
+ c.Assert(rs.Error(), ErrorMatches, "command error on ref: OK")
cs.Status = ""
- c.Assert(cs.Ok(), Equals, false)
+ c.Assert(rs.Error(), ErrorMatches, "command error on ref: ")
}
func (s *ReportStatusSuite) testEncodeDecodeOk(c *C, rs *ReportStatus, lines ...string) {