-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from adamralph/subdirectory
MSBuildIntegration.Subdirectory()
- Loading branch information
Showing
4 changed files
with
59 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
namespace MinVerTests | ||
{ | ||
using System.IO; | ||
using MinVer; | ||
using Xbehave; | ||
using Xunit; | ||
using static MinVerTests.Infra.Git; | ||
using static MinVerTests.Infra.FileSystem; | ||
using static SimpleExec.Command; | ||
|
||
public static class MSBuildIntegration | ||
{ | ||
[Scenario] | ||
public static void Subdirectory(string path, Version version) | ||
{ | ||
$"Given a git repository with a commit in '{path = GetScenarioDirectory("msbuild-integration-subdirectory")}'" | ||
.x(async () => await EnsureRepositoryWithACommit(path)); | ||
|
||
"And the git repository has a subdirectory" | ||
.x(() => EnsureEmptyDirectory(path = Path.Combine(path, "subdirectory"))); | ||
|
||
"And the current commit is tagged 1.0.0" | ||
.x(async () => await RunAsync("git", @"tag 1.0.0", path)); | ||
|
||
"When the version is determined using the subdirectory" | ||
.x(() => version = Versioner.GetVersion(path)); | ||
|
||
"Then the version is 1.0.0" | ||
.x(() => Assert.Equal("1.0.0", version.ToString())); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters