OSDN Git Service

generate test plugin on the fly, instead of downloading one from github
authorscribu <mail@scribu.net>
Fri, 3 May 2013 22:01:32 +0000 (01:01 +0300)
committerscribu <mail@scribu.net>
Fri, 3 May 2013 22:09:53 +0000 (01:09 +0300)
features/help.feature

index af077c7..5a410db 100644 (file)
@@ -29,15 +29,23 @@ Feature: Get help about WP-CLI commands
 
   Scenario: Getting help for a third-party command
     Given a WP install
-    And a google-sitemap-generator-cli plugin zip
-    And I run `wp plugin install --activate {PLUGIN_ZIP}`
-    And it should run without errors
-    And I run `wp plugin install --activate google-sitemap-generator`
+    And a wp-content/plugins/test-cli-help.php file:
+      """
+      <?php
+      // Plugin Name: Test CLI Help
+
+      class Test_Help extends WP_CLI_Command {
+        function __invoke() {}
+      }
+
+      WP_CLI::add_command( 'test-help', 'Test_Help' );
+      """
+    And I run `wp plugin activate test-cli-help`
     And it should run without errors
 
-    When I run `wp help google-sitemap`
+    When I run `wp help test-help`
     Then it should run without errors
     And STDOUT should contain:
       """
-      usage: wp google-sitemap
+      usage: wp test-help
       """