OSDN Git Service

add basic scenarios for wp-cli.yml
authorscribu <mail@scribu.net>
Sun, 24 Mar 2013 04:52:52 +0000 (06:52 +0200)
committerscribu <mail@scribu.net>
Sun, 24 Mar 2013 04:52:52 +0000 (06:52 +0200)
features/config.feature [new file with mode: 0644]
features/steps/basic_steps.php

diff --git a/features/config.feature b/features/config.feature
new file mode 100644 (file)
index 0000000..c612519
--- /dev/null
@@ -0,0 +1,26 @@
+Feature: Have a config file
+
+  Scenario: No config file
+    Given a WP install
+      """
+      """
+
+    When I run `wp --info`
+    Then it should run without errors
+    And STDOUT should not contain:
+      """
+      wp-cli.yml
+      """
+
+  Scenario: Config file in WP Root
+    Given a WP install
+    And a wp-cli.yml file:
+      """
+      """
+
+    When I run `wp --info`
+    Then it should run without errors
+    And STDOUT should contain:
+      """
+      wp-cli.yml
+      """
index 0473c39..119b8a9 100644 (file)
@@ -10,6 +10,12 @@ $steps->Given( '/^an empty directory$/',
        }
 );
 
+$steps->Given( '/^a ([^\s]+) file:$/',
+       function ( $world, $path, PyStringNode $content ) {
+               file_put_contents( $world->get_path( $path ), (string) $content );
+       }
+);
+
 $steps->Given( '/^WP files$/',
        function ( $world ) {
                $world->download_wordpress_files();