OSDN Git Service

add regression test for #645
authorscribu <mail@scribu.net>
Tue, 6 Aug 2013 21:47:19 +0000 (00:47 +0300)
committerscribu <mail@scribu.net>
Tue, 6 Aug 2013 21:47:19 +0000 (00:47 +0300)
features/help.feature

index 10626d6..b0225d0 100644 (file)
@@ -19,6 +19,36 @@ Feature: Get help about WP-CLI commands
     Then the return code should be 1
     And STDERR should not be empty
 
+  Scenario: Help for third-party commands
+    Given a WP install
+    And a wp-content/plugins/test-cli/command.php file:
+      """
+      <?php
+      // Plugin Name: Test CLI Help
+
+      class Test_Help extends WP_CLI_Command {
+        /**
+         * A dummy command.
+         */
+        function __invoke() {}
+      }
+
+      WP_CLI::add_command( 'test-help', 'Test_Help' );
+      """
+    And I run `wp plugin activate test-cli`
+
+    When I run `wp help`
+    Then STDOUT should contain:
+      """
+      A dummy command.
+      """
+
+    When I run `wp help test-help`
+    Then STDOUT should contain:
+      """
+      wp test-help
+      """
+
   Scenario: Help for incomplete commands
     Given an empty directory