github.com/mhilton/juju-juju@v0.0.0-20150901100907-a94dd2c73455/testing/git.go (about)

     1  // Copyright 2013 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package testing
     5  
     6  import (
     7  	"runtime"
     8  
     9  	gc "gopkg.in/check.v1"
    10  )
    11  
    12  type GitSuite struct {
    13  	BaseSuite
    14  }
    15  
    16  func (t *GitSuite) SetUpTest(c *gc.C) {
    17  	t.BaseSuite.SetUpTest(c)
    18  
    19  	t.PatchEnvironment("HOME", c.MkDir())
    20  	t.PatchEnvironment("LC_ALL", "C")
    21  
    22  	t.PatchEnvironment("GIT_AUTHOR_NAME", "Foo Bar")
    23  	t.PatchEnvironment("GIT_AUTHOR_EMAIL", "foo@example.org")
    24  	t.PatchEnvironment("GIT_COMMITTER_NAME", "Foo Bar")
    25  	t.PatchEnvironment("GIT_COMMITTER_EMAIL", "foo@example.org")
    26  }
    27  
    28  func SkipIfGitNotAvailable(c *gc.C) {
    29  	//TODO(bogdanteleaga): Make this actually check for git
    30  	// and work on all platforms
    31  	if runtime.GOOS == "windows" {
    32  		c.Skip("Skipping git tests on windows")
    33  	}
    34  }