From 881bba915bb93df60df4751fc92076366fa7bbfe Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sat, 22 Apr 2017 10:46:58 -0300 Subject: [PATCH] added more tests to the git pipe --- pipeline/git/git_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pipeline/git/git_test.go b/pipeline/git/git_test.go index f34d8c7e8..6a0f1dca7 100644 --- a/pipeline/git/git_test.go +++ b/pipeline/git/git_test.go @@ -102,6 +102,22 @@ func TestTagIsNotLastCommit(t *testing.T) { assert.Contains(err.Error(), "git tag v0.0.1 was not made against commit") } +func TestValidState(t *testing.T) { + var assert = assert.New(t) + _, back := createAndChdir(t) + defer back() + gitInit(t) + gitCommit(t, "commit3") + gitTag(t, "v0.0.1") + gitCommit(t, "commit4") + gitTag(t, "v0.0.2") + var ctx = &context.Context{ + Config: config.Project{}, + Validate: true, + } + assert.NoError(Pipe{}.Run(ctx)) +} + func TestNoValidate(t *testing.T) { var assert = assert.New(t) _, back := createAndChdir(t)