Skip to content

Commit

Permalink
combining ExecutableIsLocatedAt with Command to create FileName to be…
Browse files Browse the repository at this point in the history
… executed
  • Loading branch information
miensol authored and drusellers committed Jul 10, 2012
1 parent b65f329 commit 8c32217
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions product/dropkick.tests/Tasks/Console/PingTest.cs
@@ -1,9 +1,12 @@
namespace dropkick.tests.Tasks.Console
{
using System;
using dropkick.DeploymentModel;
using dropkick.Tasks.CommandLine;
using FileSystem;
using NUnit.Framework;
using Path = System.IO.Path;
using System.Linq;

[TestFixture]
public class PingTest
Expand All @@ -29,5 +32,19 @@ public void Verify()

//Assert.Contains(vi, r.Results);
}

[Test]
public void VerifyCanRunWithExecutablePathSet()
{
var t = new LocalCommandLineTask(new DotNetPath(), "ping")
{
ExecutableIsLocatedAt =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "system32"),
Args = "localhost"
};

var result = t.Execute();
result.Results.Select(r=> r.Status).ToList().ShouldContain(DeploymentItemStatus.Good);
}
}
}
2 changes: 1 addition & 1 deletion product/dropkick/Tasks/CommandLine/LocalCommandLineTask.cs
Expand Up @@ -75,7 +75,7 @@ public DeploymentResult Execute()

if (!string.IsNullOrEmpty(WorkingDirectory)) psi.WorkingDirectory = WorkingDirectory;

psi.FileName = _path.Combine(WorkingDirectory, Command);
psi.FileName = _path.Combine(ExecutableIsLocatedAt, Command);

string output;
try
Expand Down

0 comments on commit 8c32217

Please sign in to comment.