Index: testing/testbase/cleanup.go |
=== modified file 'testing/testbase/cleanup.go' |
--- testing/testbase/cleanup.go 2014-01-20 02:39:11 +0000 |
+++ testing/testbase/cleanup.go 2014-02-18 17:08:55 +0000 |
@@ -62,6 +62,13 @@ |
s.AddCleanup(func(*gc.C) { restore() }) |
} |
+// PatchEnvPathPrepend prepends the given path to the environment $PATH and restores the |
+// original path on test teardown. |
+func (s *CleanupSuite) PatchEnvPathPrepend(dir string) { |
+ restore := PatchEnvPathPrepend(dir) |
+ s.AddCleanup(func(*gc.C) { restore() }) |
+} |
+ |
// PatchValue sets the 'dest' variable the the value passed in. The old value |
// is saved and returned to the original value at test tear down time using a |
// cleanup function. The value must be assignable to the element type of the |