Skip to content

Commit

Permalink
Merge branch 'pr613-new' into stable
Browse files Browse the repository at this point in the history
* pr613-new:
  (GH-501) allow shutting off sign when no network
  (GH-448) Add Output Directory for choco new
  • Loading branch information
ferventcoder committed Apr 9, 2016
2 parents afd7892 + 3f99bcf commit 3d67a72
Show file tree
Hide file tree
Showing 7 changed files with 373 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .build/default.build
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<nant buildfile="${dirs.current.file}${path.separator}gemsPrepare.step" inheritall="true" failonerror="false" if="${run.gems}" />
<nant buildfile="${dirs.current.file}${path.separator}gemsBuild.step" inheritall="true" failonerror="false" if="${run.gems}" />
<nant buildfile="${dirs.current.file}${path.separator}nugetPrepare.step" inheritall="true" failonerror="false" if="${run.nuget}" />
<nant buildfile="${dirs.build_scripts_custom}${path.separator}codeSign.step" failonerror="true" inheritall="true" />
<nant buildfile="${dirs.build_scripts_custom}${path.separator}codeSign.step" failonerror="true" inheritall="true" if="${run.codesign}" />
<nant buildfile="${dirs.current.file}${path.separator}nugetBuild.step" inheritall="true" failonerror="false" if="${run.nuget}" />
</target>

Expand Down
1 change: 1 addition & 0 deletions src/chocolatey.tests/chocolatey.tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
<Compile Include="infrastructure.app\services\FilesServiceSpecs.cs" />
<Compile Include="infrastructure.app\services\NugetServiceSpecs.cs" />
<Compile Include="infrastructure.app\services\RegistryServiceSpecs.cs" />
<Compile Include="infrastructure.app\services\TemplateServiceSpecs.cs" />
<Compile Include="infrastructure\commands\ExternalCommandArgsBuilderSpecs.cs" />
<Compile Include="infrastructure\commandline\InteractivePromptSpecs.cs" />
<Compile Include="infrastructure\commands\CommandExecutorSpecs.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ namespace chocolatey.tests.infrastructure.app.commands
using chocolatey.infrastructure.app.attributes;
using chocolatey.infrastructure.app.commands;
using chocolatey.infrastructure.app.configuration;
using chocolatey.infrastructure.app.domain;
using chocolatey.infrastructure.app.services;
using chocolatey.infrastructure.app.templates;
using chocolatey.infrastructure.commandline;
Expand Down Expand Up @@ -102,6 +101,12 @@ public void should_add_maintainer_to_the_option_set()
{
optionSet.Contains("maintainer").ShouldBeTrue();
}

[Fact]
public void should_add_outputdirectory_to_the_option_set()
{
optionSet.Contains("outputdirectory").ShouldBeTrue();
}
}

public class when_handling_additional_argument_parsing : ChocolateyNewCommandSpecsBase
Expand Down Expand Up @@ -354,5 +359,59 @@ public void should_call_service_generate()
templateService.Verify(c => c.generate(configuration), Times.Once);
}
}

public class when_handling_arguments_parsing : ChocolateyNewCommandSpecsBase
{
private OptionSet optionSet;

public override void Context()
{
base.Context();
optionSet = new OptionSet();
command.configure_argument_parser(optionSet, configuration);
}

public override void Because()
{
optionSet.Parse(new[] { "--name", "Bob", "--automaticpackage", "--template-name", "custom", "--version", "0.42.0", "--maintainer" , "Loyd", "--outputdirectory", "c:\\packages" });
}

[Fact]
public void should_name_equal_to_Bob()
{
configuration.NewCommand.Name.ShouldEqual("Bob");
configuration.NewCommand.TemplateProperties[TemplateValues.NamePropertyName].ShouldEqual("Bob");
}

[Fact]
public void should_automaticpackage_equal_to_true()
{
configuration.NewCommand.AutomaticPackage.ShouldBeTrue();
}

[Fact]
public void should_templatename_equal_to_custom()
{
configuration.NewCommand.TemplateName.ShouldEqual("custom");
}

[Fact]
public void should_version_equal_to_42()
{
configuration.NewCommand.TemplateProperties[TemplateValues.VersionPropertyName].ShouldEqual("0.42.0");
}

[Fact]
public void should_maintainer_equal_to_Loyd()
{
configuration.NewCommand.TemplateProperties[TemplateValues.MaintainerPropertyName].ShouldEqual("Loyd");
}

[Fact]
public void should_outputdirectory_equal_packages()
{
configuration.OutputDirectory.ShouldEqual("c:\\packages");
}
}
}
}
Loading

0 comments on commit 3d67a72

Please sign in to comment.