From 79481b5b5be54f85331091bb99516c876252becb Mon Sep 17 00:00:00 2001 From: Hubery Date: Thu, 30 Apr 2015 17:24:42 +0800 Subject: [PATCH] fix TestInteractiveFailure fix test --- failure_test.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/failure_test.go b/failure_test.go index 6cb7a51..150603a 100644 --- a/failure_test.go +++ b/failure_test.go @@ -39,21 +39,21 @@ func TestInteractiveFailure(t *testing.T) { w := workflow.New() w.OnFailure = workflow.InteractiveFailure - w.AddSteps([]*workflow.Step{ - &workflow.Step{ - Label: "fail workflow", - Run: func(c workflow.Context) error { - return errors.New("generic error") - }, + w.Start = &workflow.Step{ + Label: "fail workflow", + Run: func(c workflow.Context) error { + return errors.New("generic error") }, - &workflow.Step{ - Label: "succeed workflow", - Run: func(c workflow.Context) error { - testVar = true - return nil + DependsOn: []*workflow.Step{ + &workflow.Step{ + Label: "succeed workflow", + Run: func(c workflow.Context) error { + testVar = true + return nil + }, }, }, - }) + } err := w.Run() if err != nil {