public void ShouldThrowIfFixieRunnerWasNotFound() { // Given WyamRunnerFixture fixture = new WyamRunnerFixture(); fixture.GivenDefaultToolDoNotExist(); // When, Then Assert.Throws<CakeException>(() => fixture.Run(), "Wyam: Could not locate executable."); }
public void ShouldFindWyamRunnerIfToolPathNotProvided() { // Given WyamRunnerFixture fixture = new WyamRunnerFixture(); // When ToolFixtureResult result = fixture.Run(); // Then Assert.AreEqual("/Working/tools/Wyam.exe", result.Path.FullPath); }
public void ShouldSetWorkingDirectory() { // Given WyamRunnerFixture fixture = new WyamRunnerFixture(); // When ToolFixtureResult result = fixture.Run(); // Then Assert.AreEqual("/Working", result.Process.WorkingDirectory.FullPath); }
public void ShouldUseWyamRunnerFromToolPathIfProvidedOnWindows(string toolPath, string expected) { // Given WyamRunnerFixture fixture = new WyamRunnerFixture { Settings = { ToolPath = toolPath } }; fixture.GivenSettingsToolPathExist(); // When ToolFixtureResult result = fixture.Run(); // Then Assert.AreEqual(expected, result.Path.FullPath); }
public void ShouldSetLogFilePath() { // Given WyamRunnerFixture fixture = new WyamRunnerFixture { Settings = { LogFilePath = @"/temp/log.txt" } }; // When ToolFixtureResult result = fixture.Run(); // Then Assert.AreEqual("--log \"/temp/log.txt\" \"/Working\"", result.Args); }
public void ShouldSetGlobalMetadata() { // Given WyamRunnerFixture fixture = new WyamRunnerFixture { Settings = { GlobalMetadata = new Dictionary<string, string> { { "A", "a" }, { "B", "C" } } } }; // When ToolFixtureResult result = fixture.Run(); // Then Assert.AreEqual("--global \"A=a\" --global \"B=C\" \"/Working\"", result.Args); }
public void ShouldSetVerboseFlag() { // Given WyamRunnerFixture fixture = new WyamRunnerFixture { Settings = { Verbose = true } }; // When ToolFixtureResult result = fixture.Run(); // Then Assert.AreEqual("--verbose \"/Working\"", result.Args); }
public void ShouldSetPreviewFlagAndForceExtensions() { // Given WyamRunnerFixture fixture = new WyamRunnerFixture { Settings = { Preview = true, PreviewForceExtensions = true } }; // When ToolFixtureResult result = fixture.Run(); // Then Assert.AreEqual("--preview 5080 --force-ext \"/Working\"", result.Args); }
public void ShouldThrowIfProcessWasNotStarted() { // Given WyamRunnerFixture fixture = new WyamRunnerFixture(); fixture.GivenProcessCannotStart(); // When, Then Assert.Throws<CakeException>(() => fixture.Run(), "Wyam: Process was not started."); }
public void ShouldSetUseLocalPackagesFlag() { // Given WyamRunnerFixture fixture = new WyamRunnerFixture { Settings = { UseLocalPackages = true } }; // When ToolFixtureResult result = fixture.Run(); // Then Assert.AreEqual("--use-local-packages \"/Working\"", result.Args); }
public void ShouldSetConfigurationFile() { // Given WyamRunnerFixture fixture = new WyamRunnerFixture { Settings = { ConfigurationFile = "C:/temp/config.wyam" } }; // When ToolFixtureResult result = fixture.Run(); // Then Assert.AreEqual("--config \"C:/temp/config.wyam\" \"/Working\"", result.Args); }
public void ShouldSetMultipleInputPaths() { // Given WyamRunnerFixture fixture = new WyamRunnerFixture { Settings = { InputPaths = new DirectoryPath[] { "C:/temp", "a/b" } } }; // When ToolFixtureResult result = fixture.Run(); // Then Assert.AreEqual("--input \"C:/temp\" --input \"a/b\" \"/Working\"", result.Args); }
public void ShouldSetPreviewFlagAndPortAndForceExtensionsAndPreviewRoot() { // Given WyamRunnerFixture fixture = new WyamRunnerFixture { Settings = { Preview = true, PreviewPort = 5081, PreviewForceExtensions = true, PreviewRoot = "PreviewRoot" } }; // When ToolFixtureResult result = fixture.Run(); // Then Assert.AreEqual("--preview 5081 --force-ext --preview-root \"PreviewRoot\" \"/Working\"", result.Args); }
public void ShouldSetPreviewRoot() { // Given WyamRunnerFixture fixture = new WyamRunnerFixture { Settings = { Preview = true, PreviewRoot = "PreviewRoot" } }; // When ToolFixtureResult result = fixture.Run(); // Then Assert.AreEqual("--preview 5080 --preview-root \"PreviewRoot\" \"/Working\"", result.Args); }
public void ShouldSetWorkingPathAsRootPathIfNoneSpecified() { // Given WyamRunnerFixture fixture = new WyamRunnerFixture(); // When ToolFixtureResult result = fixture.Run(); // Then Assert.AreEqual("\"/Working\"", result.Args); }
public void ShouldSetRelativeRootPath() { // Given WyamRunnerFixture fixture = new WyamRunnerFixture { Settings = { RootPath = "a/b" } }; // When ToolFixtureResult result = fixture.Run(); // Then Assert.AreEqual("\"/Working/a/b\"", result.Args); }
public void ShouldSetPackagesPath() { // Given WyamRunnerFixture fixture = new WyamRunnerFixture { Settings = { PackagesPath = "C:/temp" } }; // When ToolFixtureResult result = fixture.Run(); // Then Assert.AreEqual("--packages-path \"C:/temp\" \"/Working\"", result.Args); }
public void ShouldSetOutputScriptFlag() { // Given WyamRunnerFixture fixture = new WyamRunnerFixture { Settings = { OutputScript = true } }; // When ToolFixtureResult result = fixture.Run(); // Then Assert.AreEqual("--output-script \"/Working\"", result.Args); }
public void ShouldSetNoCleanFlag() { // Given WyamRunnerFixture fixture = new WyamRunnerFixture { Settings = { NoClean = true } }; // When ToolFixtureResult result = fixture.Run(); // Then Assert.AreEqual("--noclean \"/Working\"", result.Args); }
public void ShouldThrowIfProcessHasANonZeroExitCode() { // Given WyamRunnerFixture fixture = new WyamRunnerFixture(); fixture.GivenProcessExitsWithCode(1); // When, Then Assert.Throws<CakeException>(() => fixture.Run(), "Wyam: Process returned an error."); }
public void ShouldSetPreviewFlagAndPort() { // Given WyamRunnerFixture fixture = new WyamRunnerFixture { Settings = { Preview = true, PreviewPort = 5081 } }; // When ToolFixtureResult result = fixture.Run(); // Then Assert.AreEqual("--preview 5081 \"/Working\"", result.Args); }