OSDN Git Service

add test for #634
authorscribu <mail@scribu.net>
Tue, 6 Aug 2013 23:35:23 +0000 (02:35 +0300)
committerscribu <mail@scribu.net>
Tue, 6 Aug 2013 23:35:59 +0000 (02:35 +0300)
features/option.feature

index 66c8d78..a009349 100644 (file)
@@ -3,29 +3,46 @@ Feature: Manage WordPress options
   Scenario: Option CRUD
     Given a WP install
 
-    When I run `wp option add foo 'bar'`
+    # String values
+    When I run `wp option add str_opt 'bar'`
     Then STDOUT should not be empty
 
-    When I run `wp option get foo`
+    When I run `wp option get str_opt`
     Then STDOUT should be:
     """
     bar
     """
 
-    When I run `wp option set foo '[ 1, 2 ]' --format=json`
+    When I run `wp option delete str_opt`
+    Then STDOUT should not be empty
+
+    When I try `wp option get str_opt`
+    Then the return code should be 1
+
+
+    # Integer values
+    When I run `wp option update blog_public 0`
     Then STDOUT should not be empty
 
     When I run the previous command again
     Then STDOUT should not be empty
 
-    When I run `wp option get foo --format=json`
+    When I run `wp option get blog_public`
     Then STDOUT should be:
     """
-    [1,2]
+    0
     """
 
-    When I run `wp option delete foo`
+
+    # JSON values
+    When I run `wp option set json_opt '[ 1, 2 ]' --format=json`
     Then STDOUT should not be empty
 
-    When I try `wp option get foo`
-    Then the return code should be 1
+    When I run the previous command again
+    Then STDOUT should not be empty
+
+    When I run `wp option get json_opt --format=json`
+    Then STDOUT should be:
+    """
+    [1,2]
+    """