OSDN Git Service

Simplify expression of the run with errors condition
authorDaniel Bachhuber <d@danielbachhuber.com>
Fri, 19 Apr 2013 20:33:52 +0000 (13:33 -0700)
committerDaniel Bachhuber <d@danielbachhuber.com>
Fri, 19 Apr 2013 20:33:52 +0000 (13:33 -0700)
See https://github.com/wp-cli/wp-cli/pull/398/files#r3869578

features/steps/basic_steps.php
features/term.feature

index 9de39f0..4e1d8c2 100644 (file)
@@ -142,13 +142,6 @@ $steps->Then( '/^it should run without errors$/',
        }
 );
 
-$steps->Then( '/^it should run with errors$/' ,
-       function ( $world ) {
-               if ( empty( $world->result->STDERR ) )
-                       throw new \Exception( "No error produced" );
-       }
-);
-
 $steps->Then( '/^(STDOUT|STDERR) should (be|contain|not contain):$/',
        function ( $world, $stream, $action, PyStringNode $expected ) {
                $output = $world->result->$stream;
index 8c29b00..e8be165 100644 (file)
@@ -11,11 +11,7 @@ Feature: Manage WordPress terms
       """
 
     When I run the previous command again
-    Then it should run with errors
-    And STDERR should be:
-      """
-      Error: A term with the name provided already exists.
-      """
+    Then STDERR should not be empty
 
     When I run `wp term list post_tag --format=json`
     Then it should run without errors