[Groonga-commit] droonga/fluent-plugin-droonga at 8b7de7c [master] Add test for validation of catalog

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Feb 12 17:57:22 JST 2014


YUKI Hiroshi	2014-02-12 17:57:22 +0900 (Wed, 12 Feb 2014)

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

  Message:
    Add test for validation of catalog

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

  Modified: test/unit/catalog/test_version1.rb (+20 -0)
===================================================================
--- test/unit/catalog/test_version1.rb    2014-02-12 17:48:54 +0900 (49ba880)
+++ test/unit/catalog/test_version1.rb    2014-02-12 17:57:22 +0900 (1fdbd13)
@@ -174,4 +174,24 @@ class CatalogTest < Test::Unit::TestCase
       end
     end
   end
+
+  class ValidationTest < self
+    data(
+      :missing_effective_date => {
+        :catalog => {},
+        :error => Droonga::Catalog::MissingRequiredParameter
+      },
+      :invalid_effective_date => {
+        :catalog => {
+          "effective_date" => "invalid",
+        },
+        :error => Droonga::Catalog::MissingRequiredParameter
+      },
+    )
+    def test_validation(data)
+      assert_raise(data[:error]) do
+        create_catalog(data[:catalog], "path/to/catalog")
+      end
+    end
+  end
 end
-------------- next part --------------
HTML����������������������������...
Download 



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