Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/GitVersionCore.Tests/IntegrationTests/OtherBranchScenarios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using GitVersionCore.Tests;
using LibGit2Sharp;
using NUnit.Framework;
using Shouldly;

[TestFixture]
public class OtherBranchScenarios
Expand All @@ -20,6 +21,7 @@ public void CanTakeVersionFromReleaseBranch()
fixture.AssertFullSemver("2.0.0-alpha.1+0");
}
}

[Test]
public void BranchesWithIllegalCharsShouldNotBeUsedInVersionNames()
{
Expand All @@ -34,4 +36,25 @@ public void BranchesWithIllegalCharsShouldNotBeUsedInVersionNames()
fixture.AssertFullSemver("1.0.4-issue-m-github-569.1+5");
}
}

[Test]
public void ShouldNotGetVersionFromFeatureBranchIfNotMerged()
{
using (var fixture = new EmptyRepositoryFixture())
{
fixture.Repository.MakeATaggedCommit("1.0.0-unstable.0"); // initial commit in master

fixture.Repository.CreateBranch("feature");
fixture.Repository.Checkout("feature");
fixture.Repository.MakeATaggedCommit("1.0.1-feature.1");

fixture.Repository.Checkout("master");
fixture.Repository.CreateBranch("develop");
fixture.Repository.Checkout("develop");
fixture.Repository.MakeACommit();

var version = fixture.GetVersion();
version.SemVer.ShouldBe("1.0.0-unstable.1");
}
}
}