Skip to content

Commit 0acdd62

Browse files
committed
Add test to verify the behaviour
1 parent 68981b1 commit 0acdd62

File tree

1 file changed

+48
-2
lines changed

1 file changed

+48
-2
lines changed

src/GitVersionCore.Tests/IntegrationTests/FeatureBranchScenarios.cs

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using GitVersionCore.Tests;
44
using LibGit2Sharp;
55
using NUnit.Framework;
6+
using System.Collections.Generic;
67

78
[TestFixture]
89
public class FeatureBranchScenarios
@@ -223,7 +224,7 @@ public void BranchCreatedAfterFinishReleaseShouldInheritAndIncrementFromLastMast
223224
fixture.Checkout("develop");
224225
fixture.Repository.MergeNoFF("release/0.2.0");
225226
fixture.Repository.Branches.Remove("release/2.0.0");
226-
227+
227228
fixture.Repository.MakeACommit();
228229

229230
//validate develop branch version after merging release 0.2.0 to master and develop (finish release)
@@ -237,4 +238,49 @@ public void BranchCreatedAfterFinishReleaseShouldInheritAndIncrementFromLastMast
237238
fixture.AssertFullSemver("0.3.0-TEST-1.1+2");
238239
}
239240
}
240-
}
241+
242+
[Test]
243+
public void PickUpVersionFromMasterMarkedWithIsDevelop()
244+
{
245+
var config = new Config
246+
{
247+
VersioningMode = VersioningMode.ContinuousDelivery,
248+
Branches = new Dictionary<string, BranchConfig>
249+
{
250+
{
251+
"master", new BranchConfig()
252+
{
253+
Tag = "pre",
254+
IsDevelop = true,
255+
}
256+
},
257+
{
258+
"releases?[/-]", new BranchConfig()
259+
{
260+
Tag = "rc",
261+
}
262+
}
263+
}
264+
};
265+
266+
using (var fixture = new EmptyRepositoryFixture())
267+
{
268+
fixture.MakeACommit();
269+
270+
// create a release branch and tag a release
271+
fixture.BranchTo("release/0.10.0");
272+
fixture.MakeACommit();
273+
fixture.MakeACommit();
274+
fixture.AssertFullSemver(config, "0.10.0-rc.1+2");
275+
276+
// switch to master and verify the version
277+
fixture.Checkout("master");
278+
fixture.MakeACommit();
279+
fixture.AssertFullSemver(config, "0.10.1-pre.1+1");
280+
281+
// create a feature branch from master and verify the version
282+
fixture.BranchTo("MyFeatureD");
283+
fixture.AssertFullSemver(config, "0.10.1-MyFeatureD.1+1");
284+
}
285+
}
286+
}

0 commit comments

Comments
 (0)