From 5531c00b3ff5bb557ca15e40395c0b6c8e31f835 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Mon, 3 Jun 2019 16:04:10 -0500 Subject: [PATCH 1/6] (spec) adding additional checks --- .../scenarios/ListScenarios.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/chocolatey.tests.integration/scenarios/ListScenarios.cs b/src/chocolatey.tests.integration/scenarios/ListScenarios.cs index 49145b8e2f..3002489f1d 100644 --- a/src/chocolatey.tests.integration/scenarios/ListScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/ListScenarios.cs @@ -458,6 +458,18 @@ public override void Because() Results = Service.list_run(Configuration).ToList(); } + [Fact] + public void should_not_error() + { + // nothing necessary here + } + + [Fact] + public void should_find_exactly_one_result() + { + Results.Count.ShouldEqual(1); + } + [Fact] public void should_contain_packages_and_versions_with_a_space_between_them() { From 7a9b1f1c1763aa55c2700832a096a258db48489b Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Mon, 3 Jun 2019 16:05:50 -0500 Subject: [PATCH 2/6] (GH-1837) Specs: ensure zero results on info/exact Added tests to ensure that no results does not result in an error when searching with info or by exact name of package. --- .../scenarios/ListScenarios.cs | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/chocolatey.tests.integration/scenarios/ListScenarios.cs b/src/chocolatey.tests.integration/scenarios/ListScenarios.cs index 3002489f1d..85c1b5eded 100644 --- a/src/chocolatey.tests.integration/scenarios/ListScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/ListScenarios.cs @@ -488,6 +488,62 @@ public void should_contain_a_summary() MockLogger.contains_message("packages found").ShouldBeTrue(); } + [Fact] + public void should_contain_debugging_messages() + { + MockLogger.contains_message("Searching for package information", LogLevel.Debug).ShouldBeTrue(); + MockLogger.contains_message("Running list with the following filter", LogLevel.Debug).ShouldBeTrue(); + MockLogger.contains_message("Start of List", LogLevel.Debug).ShouldBeTrue(); + MockLogger.contains_message("End of List", LogLevel.Debug).ShouldBeTrue(); + } + } + + [Concern(typeof(ChocolateyListCommand))] + public class when_searching_for_an_exact_package_with_zero_results : ScenariosBase + { + public override void Context() + { + Configuration = Scenario.list(); + Scenario.reset(Configuration); + Scenario.add_packages_to_source_location(Configuration, "exactpackage*" + Constants.PackageExtension); + Service = NUnitSetup.Container.GetInstance(); + + Configuration.ListCommand.Exact = true; + Configuration.Input = Configuration.PackageNames = "exactpackage123"; + } + + public override void Because() + { + MockLogger.reset(); + Results = Service.list_run(Configuration).ToList(); + } + + + [Fact] + public void should_not_error() + { + // nothing necessary here + } + + + [Fact] + public void should_not_have_any_results() + { + Results.Count.ShouldEqual(0); + } + + [Fact] + public void should_not_contain_packages_that_do_not_match() + { + MockLogger.contains_message("exactpackage.dontfind").ShouldBeFalse(); + } + + [Fact] + public void should_contain_a_summary() + { + MockLogger.contains_message("packages found").ShouldBeTrue(); + } + [Fact] public void should_contain_debugging_messages() { From 3837ffdc36812fdbb030e938032517c3a5cd8ffc Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Mon, 3 Jun 2019 16:06:03 -0500 Subject: [PATCH 3/6] (maint) formatting --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2f53b037e..278a5e9740 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ This covers changes for the "chocolatey" and "chocolatey.lib" packages, which ar ## [0.10.14](https://github.com/chocolatey/choco/issues?q=milestone%3A0.10.14+is%3Aclosed) (May 30, 2019) ### BUG FIXES - * Fix - feature - Turn off Enhanced Exit Codes by Default - see [#1784](https://github.com/chocolatey/choco/issues/1784) + * Fix - feature - Turn off Enhanced Exit Codes by default - see [#1784](https://github.com/chocolatey/choco/issues/1784) * Fix - Reboot - Pending File Rename Operations check returns true, even after reboot - see [#1768](https://github.com/chocolatey/choco/issues/1768) * Fix - ".registry.bad" files are created for actually valid registry snapshots - see [#1581](https://github.com/chocolatey/choco/issues/1581) * Fix - repositories - Azure DevOps NuGet v2 endpoints don't provide metadata in Packages() queries - fails on "Authors is required." - see [#1771](https://github.com/chocolatey/choco/issues/1771) From b688aa438f89d24edd01f9ddf24fc411f69cde74 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Mon, 3 Jun 2019 16:06:23 -0500 Subject: [PATCH 4/6] (doc) update release notes for 0.10.15 --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 278a5e9740..93d10607aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ This covers changes for the "chocolatey" and "chocolatey.lib" packages, which ar **NOTE**: If you have a licensed edition of Chocolatey ("chocolatey.extension"), refer to this in tandem with [Chocolatey Licensed CHANGELOG](https://github.com/chocolatey/choco/blob/master/CHANGELOG_LICENSED.md). +## [0.10.15](https://github.com/chocolatey/choco/issues?q=milestone%3A0.10.15+is%3Aclosed) (June 3, 2019) +### BUG FIXES + * Fix - list/search/info - searching with --exact or info results in Object reference not set to an instance of an object - see [#1837](https://github.com/chocolatey/choco/issues/1837) + + ## [0.10.14](https://github.com/chocolatey/choco/issues?q=milestone%3A0.10.14+is%3Aclosed) (May 30, 2019) ### BUG FIXES * Fix - feature - Turn off Enhanced Exit Codes by default - see [#1784](https://github.com/chocolatey/choco/issues/1784) From 70f5e373ae3bbc74f27ca51e5ddafb46d2b7fc0c Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Mon, 3 Jun 2019 16:06:31 -0500 Subject: [PATCH 5/6] (version) 0.10.15 --- .uppercut | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.uppercut b/.uppercut index d3e53cf84f..74fe8cbee9 100644 --- a/.uppercut +++ b/.uppercut @@ -19,8 +19,8 @@ - - + + From 53a25927eac84b718e8247c1eb945218bb2c4bb9 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Mon, 3 Jun 2019 17:48:28 -0500 Subject: [PATCH 6/6] (GH-1837) update behavior scenarios The specs produce a Scenarios file, ensure that is updated with the latest results. --- Scenarios.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Scenarios.md b/Scenarios.md index a96c2be8f3..c9767724fb 100644 --- a/Scenarios.md +++ b/Scenarios.md @@ -400,7 +400,7 @@ * should not have inconclusive package result * should not have warning package result -### ChocolateyListCommand [ 10 Scenario(s), 41 Observation(s) ] +### ChocolateyListCommand [ 11 Scenario(s), 48 Observation(s) ] #### when listing local packages @@ -453,7 +453,17 @@ * should contain a summary * should contain debugging messages * should contain packages and versions with a space between them + * should find exactly one result * should not contain packages that do not match + * should not error + +#### when searching for an exact package with zero results + + * should contain a summary + * should contain debugging messages + * should not contain packages that do not match + * should not error + * should not have any results #### when searching packages with no filter happy path