Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(115)

Unified Diff: testing/testbase/cleanup.go

Issue 65460043: add PatchPath method
Patch Set: add PatchPath method Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « state/apiserver/client/run_test.go ('k') | testing/testbase/patch.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « state/apiserver/client/run_test.go ('k') | testing/testbase/patch.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b