[Groonga-commit] groonga/groonga-schema at fbe0972 [master] differ: support plugins

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Aug 8 14:29:17 JST 2016


Kouhei Sutou	2016-08-08 14:29:17 +0900 (Mon, 08 Aug 2016)

  New Revision: fbe0972a0f28f6e6e90d22a8723a63148d7f6890
  https://github.com/groonga/groonga-schema/commit/fbe0972a0f28f6e6e90d22a8723a63148d7f6890

  Message:
    differ: support plugins

  Modified files:
    test/test-differ.rb

  Modified: test/test-differ.rb (+20 -0)
===================================================================
--- test/test-differ.rb    2016-08-08 14:26:32 +0900 (9e9329b)
+++ test/test-differ.rb    2016-08-08 14:29:17 +0900 (9427bb5)
@@ -21,6 +21,10 @@ class DifferTest < Test::Unit::TestCase
     @differ = GroongaSchema::Differ.new(@from, @to)
   end
 
+  def plugin_register(arguments)
+    Groonga::Command::PluginRegister.new(arguments)
+  end
+
   def table_create(arguments)
     Groonga::Command::TableCreate.new(arguments)
   end
@@ -30,6 +34,22 @@ class DifferTest < Test::Unit::TestCase
   end
 
   sub_test_case "#diff" do
+    test "plugin - add" do
+      @to.apply_command(plugin_register("name" => "token_filters/stem"))
+
+      expected = GroongaSchema::Diff.new
+      expected.added_plugins.concat(@to.plugins)
+      assert_equal(expected, @differ.diff)
+    end
+
+    test "plugin - remove" do
+      @from.apply_command(plugin_register("name" => "token_filters/stem"))
+
+      expected = GroongaSchema::Diff.new
+      expected.removed_plugins.concat(@from.plugins)
+      assert_equal(expected, @differ.diff)
+    end
+
     test "table - add" do
       arguments = {
         "name"              => "Words",
-------------- next part --------------
HTML����������������������������...
Download 



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