[Groonga-commit] groonga/fluent-plugin-droonga [master] test: add custom assertion for search result

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Apr 9 17:30:21 JST 2013


Kouhei Sutou	2013-04-09 17:30:21 +0900 (Tue, 09 Apr 2013)

  New Revision: 46572f524fa109ee039172160b0d0dfc26fc07c4
  https://github.com/groonga/fluent-plugin-droonga/commit/46572f524fa109ee039172160b0d0dfc26fc07c4

  Message:
    test: add custom assertion for search result

  Modified files:
    test/plugin/test_handler_search.rb

  Modified: test/plugin/test_handler_search.rb (+10 -2)
===================================================================
--- test/plugin/test_handler_search.rb    2013-04-09 17:22:00 +0900 (b48af7d)
+++ test/plugin/test_handler_search.rb    2013-04-09 17:30:21 +0900 (d7d2bee)
@@ -45,15 +45,23 @@ class SearchHandlerTest < Test::Unit::TestCase
     @handler = nil
   end
 
+  def search(request)
+    @handler.search(request)
+  end
+
+  def assert_search(expected, request)
+    assert_equal(expected, search(request))
+  end
+
   class NoParameterTest < self
     def test_empty
-      assert_equal({}, @handler.search({}))
+      assert_search({}, {})
     end
   end
 
   class QueriesTest < self
     def test_empty
-      assert_equal({}, @handler.search({"queries" => []}))
+      assert_search({}, {"queries" => {}})
     end
   end
 end
-------------- next part --------------
HTML����������������������������...
Download 



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