aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/protocol/packp/capability/capability_test.go
blob: f1fd0282a7d4b77452c77c792f802f90f0bf5890 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package capability

import (
	"fmt"
	"os"

	check "gopkg.in/check.v1"
)

var _ = check.Suite(&SuiteCapabilities{})

func (s *SuiteCapabilities) TestDefaultAgent(c *check.C) {
	os.Unsetenv("GO_GIT_USER_AGENT_EXTRA")
	ua := DefaultAgent()
	c.Assert(ua, check.Equals, userAgent)
}

func (s *SuiteCapabilities) TestEnvAgent(c *check.C) {
	os.Setenv("GO_GIT_USER_AGENT_EXTRA", "abc xyz")
	ua := DefaultAgent()
	c.Assert(ua, check.Equals, fmt.Sprintf("%s %s", userAgent, "abc xyz"))
}