-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from wp-cli/20-version-requirements-in-shorten…
…ed-syntax Add tests for version requirements added to shortened package identifiers.
- Loading branch information
Showing
1 changed file
with
185 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,31 +174,75 @@ Feature: Install WP-CLI packages | |
Scenario: Install a package from Git using a shortened package identifier | ||
Given an empty directory | ||
|
||
When I run `wp package install wp-cli/google-sitemap-generator-cli` | ||
When I run `wp package install schlessera/test-command` | ||
Then STDOUT should contain: | ||
""" | ||
Installing package wp-cli/google-sitemap-generator-cli (dev-master) | ||
Installing package schlessera/test-command (dev-master) | ||
Updating {PACKAGE_PATH}composer.json to require the package... | ||
Registering [email protected]:wp-cli/google-sitemap-generator-cli.git as a VCS repository... | ||
Registering [email protected]:schlessera/test-command.git as a VCS repository... | ||
Using Composer to install the package... | ||
""" | ||
And STDOUT should contain: | ||
""" | ||
Success: Package installed. | ||
""" | ||
|
||
When I run `wp package list --fields=name,version` | ||
Then STDOUT should be a table containing rows: | ||
| name | version | | ||
| schlessera/test-command | dev-master | | ||
|
||
When I run `wp test-command` | ||
Then STDOUT should contain: | ||
""" | ||
Success: Version E. | ||
""" | ||
|
||
When I run `wp package uninstall schlessera/test-command` | ||
Then STDOUT should contain: | ||
""" | ||
Removing require statement from {PACKAGE_PATH}composer.json | ||
""" | ||
And STDOUT should contain: | ||
""" | ||
Success: Uninstalled package. | ||
""" | ||
|
||
When I run `wp package list --fields=name` | ||
Then STDOUT should not contain: | ||
""" | ||
schlessera/test-command | ||
""" | ||
|
||
@github-api @shortened | ||
Scenario: Install a package from Git using a shortened package identifier with a version requirement | ||
Given an empty directory | ||
|
||
When I run `wp package install schlessera/test-command:^0` | ||
Then STDOUT should contain: | ||
""" | ||
Installing package schlessera/test-command (^0) | ||
Updating {PACKAGE_PATH}composer.json to require the package... | ||
Registering [email protected]:schlessera/test-command.git as a VCS repository... | ||
Using Composer to install the package... | ||
""" | ||
And STDOUT should contain: | ||
""" | ||
Success: Package installed. | ||
""" | ||
|
||
When I run `wp package list --fields=name,version` | ||
Then STDOUT should be a table containing rows: | ||
| name | | ||
| wp-cli/google-sitemap-generator-cli | | ||
| name | version | | ||
| schlessera/test-command | v0.2.0 | | ||
|
||
When I run `wp google-sitemap` | ||
When I run `wp test-command` | ||
Then STDOUT should contain: | ||
""" | ||
usage: wp google-sitemap rebuild | ||
Success: Version C. | ||
""" | ||
|
||
When I run `wp package uninstall wp-cli/google-sitemap-generator-cli` | ||
When I run `wp package uninstall schlessera/test-command` | ||
Then STDOUT should contain: | ||
""" | ||
Removing require statement from {PACKAGE_PATH}composer.json | ||
|
@@ -211,7 +255,139 @@ Feature: Install WP-CLI packages | |
When I run `wp package list --fields=name` | ||
Then STDOUT should not contain: | ||
""" | ||
wp-cli/google-sitemap-generator-cli | ||
schlessera/test-command | ||
""" | ||
|
||
@github-api @shortened | ||
Scenario: Install a package from Git using a shortened package identifier with a specific version | ||
Given an empty directory | ||
|
||
When I run `wp package install schlessera/test-command:0.1.0` | ||
Then STDOUT should contain: | ||
""" | ||
Installing package schlessera/test-command (0.1.0) | ||
Updating {PACKAGE_PATH}composer.json to require the package... | ||
Registering [email protected]:schlessera/test-command.git as a VCS repository... | ||
Using Composer to install the package... | ||
""" | ||
And STDOUT should contain: | ||
""" | ||
Success: Package installed. | ||
""" | ||
|
||
When I run `wp package list --fields=name,version` | ||
Then STDOUT should be a table containing rows: | ||
| name | version | | ||
| schlessera/test-command | v0.1.0 | | ||
|
||
When I run `wp test-command` | ||
Then STDOUT should contain: | ||
""" | ||
Success: Version A. | ||
""" | ||
|
||
When I run `wp package uninstall schlessera/test-command` | ||
Then STDOUT should contain: | ||
""" | ||
Removing require statement from {PACKAGE_PATH}composer.json | ||
""" | ||
And STDOUT should contain: | ||
""" | ||
Success: Uninstalled package. | ||
""" | ||
|
||
When I run `wp package list --fields=name` | ||
Then STDOUT should not contain: | ||
""" | ||
schlessera/test-command | ||
""" | ||
|
||
@github-api @shortened | ||
Scenario: Install a package from Git using a shortened package identifier and a specific commit hash | ||
Given an empty directory | ||
|
||
When I run `wp package install schlessera/test-command:dev-master#8e99bba16a65a3cde7405178a6badbb49349f554` | ||
Then STDOUT should contain: | ||
""" | ||
Installing package schlessera/test-command (dev-master#8e99bba16a65a3cde7405178a6badbb49349f554) | ||
Updating {PACKAGE_PATH}composer.json to require the package... | ||
Registering [email protected]:schlessera/test-command.git as a VCS repository... | ||
Using Composer to install the package... | ||
""" | ||
And STDOUT should contain: | ||
""" | ||
Success: Package installed. | ||
""" | ||
|
||
When I run `wp package list --fields=name,version` | ||
Then STDOUT should be a table containing rows: | ||
| name | version | | ||
| schlessera/test-command | dev-master | | ||
|
||
When I run `wp test-command` | ||
Then STDOUT should contain: | ||
""" | ||
Success: Version B. | ||
""" | ||
|
||
When I run `wp package uninstall schlessera/test-command` | ||
Then STDOUT should contain: | ||
""" | ||
Removing require statement from {PACKAGE_PATH}composer.json | ||
""" | ||
And STDOUT should contain: | ||
""" | ||
Success: Uninstalled package. | ||
""" | ||
|
||
When I run `wp package list --fields=name` | ||
Then STDOUT should not contain: | ||
""" | ||
schlessera/test-command | ||
""" | ||
|
||
@github-api @shortened | ||
Scenario: Install a package from Git using a shortened package identifier and a branch | ||
Given an empty directory | ||
|
||
When I run `wp package install schlessera/test-command:dev-custom-branch` | ||
Then STDOUT should contain: | ||
""" | ||
Installing package schlessera/test-command (dev-custom-branch) | ||
Updating {PACKAGE_PATH}composer.json to require the package... | ||
Registering [email protected]:schlessera/test-command.git as a VCS repository... | ||
Using Composer to install the package... | ||
""" | ||
And STDOUT should contain: | ||
""" | ||
Success: Package installed. | ||
""" | ||
|
||
When I run `wp package list --fields=name,version` | ||
Then STDOUT should be a table containing rows: | ||
| name | version | | ||
| schlessera/test-command | dev-custom-branch | | ||
|
||
When I run `wp test-command` | ||
Then STDOUT should contain: | ||
""" | ||
Success: Version D. | ||
""" | ||
|
||
When I run `wp package uninstall schlessera/test-command` | ||
Then STDOUT should contain: | ||
""" | ||
Removing require statement from {PACKAGE_PATH}composer.json | ||
""" | ||
And STDOUT should contain: | ||
""" | ||
Success: Uninstalled package. | ||
""" | ||
|
||
When I run `wp package list --fields=name` | ||
Then STDOUT should not contain: | ||
""" | ||
schlessera/test-command | ||
""" | ||
|
||
Scenario: Install a package in a local zip | ||
|