From 8a7d97951d540244c1d2cd2a1e34cb2083d55ca6 Mon Sep 17 00:00:00 2001 From: Stephen Valdinger Date: Mon, 14 Nov 2022 14:06:06 -0500 Subject: [PATCH] (#2899) Address PR feedback Add link to new issue in TODO block for handling multiple package ids in the info command Call because() method directly in tests, as we've done the setup there Remove Exception decorator from error variable in tests --- .../commands/ChocolateyInfoCommandSpecs.cs | 6 +++--- .../infrastructure.app/commands/ChocolateyInfoCommand.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chocolatey.tests/infrastructure.app/commands/ChocolateyInfoCommandSpecs.cs b/src/chocolatey.tests/infrastructure.app/commands/ChocolateyInfoCommandSpecs.cs index 44c2430b1f..09c9331b9f 100644 --- a/src/chocolatey.tests/infrastructure.app/commands/ChocolateyInfoCommandSpecs.cs +++ b/src/chocolatey.tests/infrastructure.app/commands/ChocolateyInfoCommandSpecs.cs @@ -157,7 +157,7 @@ public void show_throw_when_package_id_is_not_set() try { - command.handle_validation(configuration); + because(); } catch (Exception ex) { @@ -173,11 +173,11 @@ public void show_throw_when_package_id_is_not_set() public void should_throw_when_multiple_package_ids_set() { configuration.Input = "foo bar"; - Exception error = null; + error = null; try { - command.handle_validation(configuration); + because(); } catch (Exception ex) { diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyInfoCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyInfoCommand.cs index b9db38712e..36237f58ee 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyInfoCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyInfoCommand.cs @@ -95,7 +95,7 @@ public override void handle_validation(ChocolateyConfiguration configuration) } //Validate only a single package has been passed to info - //TODO: Provide ability to get info on a list of packages + //TODO: Provide ability to get info on a list of packages. See https://github.com/chocolatey/choco/issues/2905 string[] input = configuration.Input.Split(' '); if (input.Count() > 1) {