Skip to content

Commit

Permalink
(GH-450)(specs) More integration specs for list
Browse files Browse the repository at this point in the history
Add the following Scenarios:
- when searching all available packages
- when searching for a particular package
- when searching packages with no filter
- when searching packages with verbose
  • Loading branch information
ferventcoder committed Oct 5, 2015
1 parent 6de4e51 commit a330a00
Show file tree
Hide file tree
Showing 4 changed files with 257 additions and 45 deletions.
37 changes: 35 additions & 2 deletions Scenarios.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,9 @@
* should not have inconclusive package result
* should not have warning package result

### ChocolateyListCommand [ 2 Scenario(s), 9 Observation(s) ]
### ChocolateyListCommand [ 6 Scenario(s), 30 Observation(s) ]

#### when listing local packages happy path
#### when listing local packages

* should contain a summary
* should contain debugging messages
Expand All @@ -363,6 +363,39 @@
* should not contain packages and versions with a space between them
* should only have messages related to package information

#### when searching all available packages

* should contain a summary
* should contain debugging messages
* should contain packages and versions with a space between them
* should list available packages as many times as they show on the feed
* should not contain packages and versions with a pipe between them

#### when searching for a particular package

* should contain a summary
* should contain debugging messages
* should contain packages and versions with a space between them
* should not contain packages that do not match

#### when searching packages with no filter happy path

* should contain a summary
* should contain debugging messages
* should contain packages and versions with a space between them
* should list available packages only once
* should not contain packages and versions with a pipe between them

#### when searching packages with verbose

* should contain a summary
* should contain debugging messages
* should contain description
* should contain download counts
* should contain packages and versions with a space between them
* should contain tags
* should not contain packages and versions with a pipe between them

### ChocolateyUninstallCommand [ 13 Scenario(s), 90 Observation(s) ]

#### when force uninstalling a package
Expand Down
8 changes: 6 additions & 2 deletions src/chocolatey.tests.integration/Scenario.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ public static void install_package(ChocolateyConfiguration config, string packag

private static ChocolateyConfiguration baseline_configuration()
{
// note that this does not mean an empty configuration. It does get influenced by
// prior commands, so ensure that all items go back to the default values here
var config = NUnitSetup.Container.GetInstance<ChocolateyConfiguration>();

config.AcceptLicense = true;
Expand All @@ -133,6 +135,10 @@ private static ChocolateyConfiguration baseline_configuration()
config.Sources = _fileSystem.get_full_path(_fileSystem.combine_paths(get_top_level(), "packages"));
config.Version = null;
config.Debug = true;
config.AllVersions = false;
config.Verbose = false;
config.Input = config.PackageNames = string.Empty;
config.ListCommand.LocalOnly = false;

return config;
}
Expand Down Expand Up @@ -165,8 +171,6 @@ public static ChocolateyConfiguration list()
{
var config = baseline_configuration();
config.CommandName = CommandNameType.list.to_string();
config.ListCommand.LocalOnly = true;
config.Sources = ApplicationParameters.PackagesLocation;

return config;
}
Expand Down
3 changes: 0 additions & 3 deletions src/chocolatey.tests.integration/TODO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ public class TODO
* - uninstall as a dependency
* - uninstall as a dependency with force
*
* List scenarios:
* - list local
* - list lp
*
*/
}
Expand Down
Loading

0 comments on commit a330a00

Please sign in to comment.