[Groonga-commit] droonga/fluent-plugin-droonga at fada464 [master] Add more validation tests

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Feb 12 18:14:15 JST 2014


YUKI Hiroshi	2014-02-12 18:14:15 +0900 (Wed, 12 Feb 2014)

  New Revision: fada464b5ee8eceeb4f850e94df2adde354bdee2
  https://github.com/droonga/fluent-plugin-droonga/commit/fada464b5ee8eceeb4f850e94df2adde354bdee2

  Message:
    Add more validation tests

  Modified files:
    test/unit/catalog/test_version1.rb

  Modified: test/unit/catalog/test_version1.rb (+28 -0)
===================================================================
--- test/unit/catalog/test_version1.rb    2014-02-12 18:10:49 +0900 (a7686e6)
+++ test/unit/catalog/test_version1.rb    2014-02-12 18:14:15 +0900 (9a232fd)
@@ -194,6 +194,12 @@ class CatalogTest < Test::Unit::TestCase
           },
         }
       end
+
+      def valid_catalog_base
+        minimum_data.merge(
+          "farms" => valid_farms,
+        )
+      end
     end
 
     data(
@@ -220,6 +226,14 @@ class CatalogTest < Test::Unit::TestCase
         },
         :error => Droonga::Catalog::MissingRequiredParameter,
       },
+      :array_farms => {
+        :catalog => {
+          "effective_date" => minimum_data["effective_date"],
+          "zones" => minimum_data["zones"],
+          "farms" => [],
+        },
+        :error => Droonga::Catalog::MismatchedParameterType,
+      },
       :no_device_farm => {
         :catalog => {
           "effective_date" => minimum_data["effective_date"],
@@ -230,6 +244,20 @@ class CatalogTest < Test::Unit::TestCase
         },
         :error => Droonga::Catalog::MissingRequiredParameter,
       },
+      :missing_datasets => {
+        :catalog => {
+          "effective_date" => minimum_data["effective_date"],
+          "zones" => minimum_data["zones"],
+          "farms" => valid_farms,
+        },
+        :error => Droonga::Catalog::MissingRequiredParameter,
+      },
+      :array_datasets => {
+        :catalog => valid_catalog_base.merge(
+          "datasets" => [],
+        ),
+        :error => Droonga::Catalog::MismatchedParameterType,
+      },
     )
     def test_validation(data)
       assert_raise(data[:error]) do
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index