Example #1
0
func TestRemoveAllMissing(t *testing.T) {
	td, err := ioutil.TempDir("", "pre-commit-go")
	ut.ExpectEqual(t, nil, err)

	foo := filepath.Join(td, "foo")
	err = ioutil.WriteFile(foo, []byte("yo"), 0600)
	ut.ExpectEqual(t, nil, err)
	ut.AssertEqual(t, nil, RemoveAll(td))
}
Example #2
0
func TestCoveragePrerequisites(t *testing.T) {
	// This test can't be parallel.
	if !IsContinuousIntegration() {
		old := os.Getenv("CI")
		defer func() {
			ut.ExpectEqual(t, nil, os.Setenv("CI", old))
		}()
		ut.AssertEqual(t, nil, os.Setenv("CI", "true"))
		ut.AssertEqual(t, true, IsContinuousIntegration())
	}
	c := Coverage{UseCoveralls: true}
	ut.AssertEqual(t, 1, len(c.GetPrerequisites()))
}