Skip to content

Commit 04d90ed

Browse files
committed
Add test for new flag
1 parent 99e3138 commit 04d90ed

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

features/dist-archive.feature

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,26 @@ Feature: Generate a distribution archive of a project
148148
| format | extension | extract |
149149
| zip | zip | unzip |
150150
| targz | tar.gz | tar -zxvf |
151+
152+
Scenario: Create directories automatically if requested
153+
Given a WP install
154+
155+
When I run `wp scaffold plugin hello-world`
156+
Then the wp-content/plugins/hello-world directory should exist
157+
And the wp-content/plugins/hello-world/hello-world.php file should exist
158+
And the wp-content/plugins/hello-world/.travis.yml file should exist
159+
And the wp-content/plugins/hello-world/bin directory should exist
160+
161+
When I try `wp dist-archive wp-content/plugins/hello-world {RUN_DIR}/some/nested/folder/hello-world.zip`
162+
Then STDERR should contain:
163+
"""
164+
Error: Target directory does not exist
165+
"""
166+
167+
When I run `wp dist-archive --create-target-dir wp-content/plugins/hello-world {RUN_DIR}/some/nested/folder/hello-world.zip`
168+
Then STDOUT should be:
169+
"""
170+
Success: Created hello-world.zip
171+
"""
172+
And STDERR should be empty
173+
And the {RUN_DIR}/some/nested/folder/hello-world.zip file should exist

0 commit comments

Comments
 (0)