mirror of
https://ghproxy.net/https://github.com/wp-cli/scaffold-package-command.git
synced 2025-10-04 04:02:29 +08:00
run -> try; return code checks.
This commit is contained in:
parent
cd6cf7eb03
commit
ccae19b924
4 changed files with 24 additions and 3 deletions
|
@ -9,6 +9,7 @@ Feature: Scaffold GitHub configuration for an existing package
|
|||
"""
|
||||
Error: Directory does not exist.
|
||||
"""
|
||||
And the return code should be 1
|
||||
|
||||
Scenario: Fails when invalid package provided
|
||||
Given an empty directory
|
||||
|
@ -23,6 +24,7 @@ Feature: Scaffold GitHub configuration for an existing package
|
|||
"""
|
||||
Error: Invalid package directory. composer.json file must be present.
|
||||
"""
|
||||
And the return code should be 1
|
||||
|
||||
Scenario: Scaffold GitHub configuration based on defaults
|
||||
Given an empty directory
|
||||
|
|
|
@ -9,6 +9,7 @@ Feature: Scaffold a README.md file for an existing package
|
|||
"""
|
||||
Error: Directory does not exist.
|
||||
"""
|
||||
And the return code should be 1
|
||||
|
||||
Scenario: Fails when invalid package provided
|
||||
Given an empty directory
|
||||
|
@ -23,6 +24,7 @@ Feature: Scaffold a README.md file for an existing package
|
|||
"""
|
||||
Error: Invalid package directory. composer.json file must be present.
|
||||
"""
|
||||
And the return code should be 1
|
||||
|
||||
Scenario: Scaffold a README.md based on the defaults
|
||||
Given an empty directory
|
||||
|
@ -249,6 +251,7 @@ Feature: Scaffold a README.md file for an existing package
|
|||
"""
|
||||
Error: Missing one or more commands defined in composer.json -> extra -> commands.
|
||||
"""
|
||||
And the return code should be 1
|
||||
|
||||
Scenario: README for a bundled command
|
||||
Given an empty directory
|
||||
|
|
|
@ -33,6 +33,7 @@ Feature: Scaffold the test suite for an existing package
|
|||
"""
|
||||
Error: Directory does not exist.
|
||||
"""
|
||||
And the return code should be 1
|
||||
|
||||
Scenario: Fails when invalid package provided
|
||||
Given an empty directory
|
||||
|
@ -47,6 +48,7 @@ Feature: Scaffold the test suite for an existing package
|
|||
"""
|
||||
Error: Invalid package directory. composer.json file must be present.
|
||||
"""
|
||||
And the return code should be 1
|
||||
|
||||
Scenario: Scaffold package tests
|
||||
Given a invalid-command/command.php file:
|
||||
|
@ -100,6 +102,7 @@ Feature: Scaffold the test suite for an existing package
|
|||
"""
|
||||
Error: Invalid package directory. composer.json file must be present.
|
||||
"""
|
||||
And the return code should be 1
|
||||
|
||||
Scenario: Scaffolds .travis.yml configuration file by default
|
||||
When I run `wp scaffold package-tests community-command`
|
||||
|
@ -135,6 +138,11 @@ Feature: Scaffold the test suite for an existing package
|
|||
Then the community-command/features/load-wp-cli.feature file should not exist
|
||||
And the community-command/features/command.feature file should exist
|
||||
|
||||
When I run `wp scaffold package-tests community-command --force`
|
||||
When I try `wp scaffold package-tests community-command --force`
|
||||
Then the community-command/features/load-wp-cli.feature file should not exist
|
||||
And the community-command/features/command.feature file should exist
|
||||
And STDERR should contain:
|
||||
"""
|
||||
Warning: File already exists
|
||||
"""
|
||||
And the return code should be 0
|
||||
|
|
|
@ -108,6 +108,7 @@ Feature: Scaffold WP-CLI commands
|
|||
"""
|
||||
Error: 'foo' is an invalid package name. Package scaffold expects '<author>/<package>'.
|
||||
"""
|
||||
And the return code should be 1
|
||||
|
||||
Scenario: Scaffold a WP-CLI command to a custom directory
|
||||
Given an empty directory
|
||||
|
@ -155,7 +156,7 @@ Feature: Scaffold WP-CLI commands
|
|||
Success: Created package files
|
||||
"""
|
||||
|
||||
When I run `wp scaffold package wp-cli/same-package --skip-tests --skip-github < session`
|
||||
When I try `wp scaffold package wp-cli/same-package --skip-tests --skip-github < session`
|
||||
And STDERR should contain:
|
||||
"""
|
||||
Warning: File already exists
|
||||
|
@ -164,6 +165,8 @@ Feature: Scaffold WP-CLI commands
|
|||
"""
|
||||
All package files were skipped
|
||||
"""
|
||||
And the return code should be 0
|
||||
|
||||
When I run `wp package uninstall wp-cli/same-package`
|
||||
Then STDOUT should contain:
|
||||
"""
|
||||
|
@ -226,12 +229,17 @@ Feature: Scaffold WP-CLI commands
|
|||
Scenario: Use tilde for HOME in package directory path
|
||||
Given an empty directory
|
||||
|
||||
When I run `wp scaffold package bar/foo --dir=~/foo --force --skip-tests --skip-readme`
|
||||
When I try `wp scaffold package bar/foo --dir=~/foo --force --skip-tests --skip-readme`
|
||||
Then STDOUT should contain:
|
||||
"""
|
||||
Success: Package installed.
|
||||
"""
|
||||
And STDERR should contain:
|
||||
"""
|
||||
Warning: File already exists
|
||||
"""
|
||||
And the /tmp/wp-cli-home/foo directory should exist
|
||||
And the return code should be 0
|
||||
|
||||
Scenario: Scaffold a package but skip installation and GitHub templates
|
||||
Given an empty directory
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue