forked from cake-contrib/Cake.Issues
-
Notifications
You must be signed in to change notification settings - Fork 0
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 cake-contrib#3 from cake-contrib/feature/cake-cont…
…ribgh-1 (cake-contribGH-1) Check for binary files not tracked by LFS
- Loading branch information
Showing
9 changed files
with
424 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
namespace Cake.Issues.GitRepository.Tests | ||
{ | ||
using System.Collections.Generic; | ||
using Cake.Testing.Fixtures; | ||
|
||
internal class GitRunnerFixture : ToolFixture<GitRunnerSettings> | ||
{ | ||
private readonly List<string> standardOutput = new List<string>(); | ||
|
||
public GitRunnerFixture() | ||
: base("git") | ||
{ | ||
} | ||
|
||
public IEnumerable<string> StandardOutput => this.standardOutput; | ||
|
||
protected override void RunTool() | ||
{ | ||
this.standardOutput.Clear(); | ||
|
||
var tool = new GitRunner(this.FileSystem, this.Environment, this.ProcessRunner, this.Tools); | ||
|
||
var output = tool.RunCommand(this.Settings); | ||
|
||
if (output != null) | ||
{ | ||
this.standardOutput.AddRange(output); | ||
} | ||
} | ||
} | ||
} |
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,39 @@ | ||
namespace Cake.Issues.GitRepository.Tests | ||
{ | ||
using Cake.Issues.Testing; | ||
using Shouldly; | ||
using Xunit; | ||
|
||
public sealed class GitRunnerTests | ||
{ | ||
public sealed class TheRunCommandMethod | ||
{ | ||
[Fact] | ||
public void Should_Throw_If_Settings_Are_Null() | ||
{ | ||
// Given | ||
var fixture = new GitRunnerFixture | ||
{ | ||
Settings = null, | ||
}; | ||
|
||
// When | ||
var result = Record.Exception(() => fixture.Run()); | ||
|
||
// Then | ||
result.IsArgumentNullException("settings"); | ||
} | ||
|
||
[Fact] | ||
public void Arguments_Should_Be_Added_If_Settings_Are_Passed() | ||
{ | ||
var fixture = new GitRunnerFixture(); | ||
fixture.Settings.Arguments.Add("Bar"); | ||
|
||
var result = fixture.Run(); | ||
|
||
result.Args.ShouldBe("Bar"); | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.