Merge pull request #155 from wp-cli/update-tests-enable-error-reporting

Update scaffolded tests to enable error reporting
This commit is contained in:
Daniel Bachhuber 2017-11-20 07:13:09 -08:00 committed by GitHub
commit 70ad122dbd
4 changed files with 20 additions and 4 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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,12 @@ 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 run `HOME={RUN_DIR} wp scaffold package bar/foo --dir=~/foo --force --skip-tests --skip-readme`
Then STDOUT should contain:
"""
Success: Package installed.
"""
And the /tmp/wp-cli-home/foo directory should exist
And the {RUN_DIR}/foo directory should exist

Scenario: Scaffold a package but skip installation and GitHub templates
Given an empty directory