// TestNonActionCallsToActionMethodsFail does exactly what its name says: // it simply makes sure that Action-related calls to HookContexts with a nil // actionData member error out correctly. func (s *InterfaceSuite) TestNonActionCallsToActionMethodsFail(c *gc.C) { ctx := context.HookContext{} _, err := ctx.ActionParams() c.Check(err, gc.ErrorMatches, "not running an action") err = ctx.SetActionFailed() c.Check(err, gc.ErrorMatches, "not running an action") err = ctx.SetActionMessage("foo") c.Check(err, gc.ErrorMatches, "not running an action") err = ctx.UpdateActionResults([]string{"1", "2", "3"}, "value") c.Check(err, gc.ErrorMatches, "not running an action") }