juju/juju — pull request #1084 by fwereade (2014-11-08 08:53:08+00:00)
Title: Uniter context: export FlushContext

Most of the tests for finalizeContext, which is *complex* (not to mention complicated...) were invoking it by side-effect. So, it was really not well tested at all; to rectify this:

* context.Runner now uses a context.Context interface, not an explicit *HookContext
* the finalizeContext method became FlushContext
* the hookVars func became a HookVars method
* the context ActionData method replaces an ad-hoc combination of similarly horrible access methods
* the various flush tests that depended on running a fake hook are now calling FlushContext directly; and slightly more than before, although (tbh) not *enough* by a long shot
* context.Runner.Run* methods are now tested using a mock context.Context, so we now have *actual tests* that the contexts get flushed
* makeCharm/hookSpec now creates scripts in arbitrary dirs, so we can actually *test running an action* /grrmbl