[Groonga-commit] groonga/fluent-plugin-groonga at 8a8e614 [use-v0.14-api] test: use Fluent::Test::Helpers for v0.14

Back to archive index

Kentaro Hayashi null+****@clear*****
Tue Apr 11 18:43:29 JST 2017


Kentaro Hayashi	2017-04-11 18:43:29 +0900 (Tue, 11 Apr 2017)

  New Revision: 8a8e614f9645a6dea1cbe7f9a34f0d6b2423ed60
  https://github.com/groonga/fluent-plugin-groonga/commit/8a8e614f9645a6dea1cbe7f9a34f0d6b2423ed60

  Message:
    test: use Fluent::Test::Helpers for v0.14

  Modified files:
    test/test_input.rb
    test/test_output.rb

  Modified: test/test_input.rb (+3 -1)
===================================================================
--- test/test_input.rb    2017-04-11 18:39:03 +0900 (563cbcf)
+++ test/test_input.rb    2017-04-11 18:43:29 +0900 (63d62f2)
@@ -22,15 +22,17 @@ require "webrick/config"
 require "webrick/httpresponse"
 
 require "fluent/test"
+require 'fluent/test/helpers'
 require "fluent/plugin/in_groonga"
 
 require "http_parser"
 
 class GroongaInputTest < Test::Unit::TestCase
+  include Fluent::Test::Helpers
   setup :before => :append
   def setup_fluent
     Fluent::Test.setup
-    @now = Time.parse("2012-10-26T08:45:42Z").to_i
+    @now = event_time("2012-10-26T08:45:42Z").to_i
     Fluent::Engine.now = @now
   end
 

  Modified: test/test_output.rb (+6 -4)
===================================================================
--- test/test_output.rb    2017-04-11 18:39:03 +0900 (5728300)
+++ test/test_output.rb    2017-04-11 18:43:29 +0900 (6b6e941)
@@ -22,12 +22,14 @@ require "webrick/config"
 require "webrick/httpresponse"
 
 require "fluent/test"
+require 'fluent/test/helpers'
 require "fluent/plugin/out_groonga"
 require "fluent/test/driver/output"
 
 require "http_parser"
 
 class GroongaOutputTest < Test::Unit::TestCase
+  include Fluent::Test::Helpers
   setup :before => :append
   def setup_fluent
     Fluent::Test.setup
@@ -99,7 +101,7 @@ EOC
       def test_basic_command
         @response_body = JSON.generate([[0, 0.0, 0.0], true])
         driver = create_driver
-        time = Time.parse("2012-10-26T08:45:42Z").to_i
+        time = event_time("2012-10-26T08:45:42Z").to_i
         driver.run(default_tag: "groonga.command.table_create") do
           driver.feed(time, {"name" => "Users"})
         end
@@ -119,7 +121,7 @@ EOC
       def test_one_message
         @response_body = JSON.generate([[0, 0.0, 0.0], [1]])
         driver = create_driver
-        time = Time.parse("2012-10-26T08:45:42Z").to_i
+        time = event_time("2012-10-26T08:45:42Z").to_i
         driver.run(default_tag: "log") do
           driver.feed(time, {"message" => "1st message"})
         end
@@ -132,7 +134,7 @@ EOC
       def test_multiple_messages
         @response_body = JSON.generate([[0, 0.0, 0.0], [2]])
         driver = create_driver
-        time = Time.parse("2012-10-26T08:45:42Z").to_i
+        time = event_time("2012-10-26T08:45:42Z").to_i
         driver.run(default_tag: "log") do
           driver.feed(time, {"message" => "1st message"})
           driver.feed(time + 1, {"message" => "2nd message"})
@@ -233,7 +235,7 @@ EOC
     class CommandTest < self
       def test_basic_command
         driver = create_driver
-        time = Time.parse("2012-10-26T08:45:42Z").to_i
+        time = event_time("2012-10-26T08:45:42Z").to_i
         driver.run(default_tag: "groonga.command.table_create") do
           driver.feed(time, {"name" => "Users"})
         end
-------------- next part --------------
HTML����������������������������...
下载 



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