[Groonga-commit] groonga/groonga-query-log at 3e34cc4 [master] Group tests for FormatRegressionTestLogs.new

Back to archive index
Kouhei Sutou null+****@clear*****
Mon Jan 21 13:12:42 JST 2019


Kouhei Sutou	2019-01-21 13:12:42 +0900 (Mon, 21 Jan 2019)

  Revision: 3e34cc42ec30a5e81b35d7f7bcb6ef00ecd1cc21
  https://github.com/groonga/groonga-query-log/commit/3e34cc42ec30a5e81b35d7f7bcb6ef00ecd1cc21

  Message:
    Group tests for FormatRegressionTestLogs.new

  Modified files:
    test/command/test-format-regression-test-logs.rb

  Modified: test/command/test-format-regression-test-logs.rb (+14 -9)
===================================================================
--- test/command/test-format-regression-test-logs.rb    2019-01-21 13:11:51 +0900 (d454b84)
+++ test/command/test-format-regression-test-logs.rb    2019-01-21 13:12:42 +0900 (84f01f7)
@@ -110,13 +110,17 @@ Backtrace:
                  run_command([fixture_path("error.log")]))
   end
 
-  def test_output_option
-    output = StringIO.new("output-option")
-    options = {:output => output}
-    command = GroongaQueryLog::Command::FormatRegressionTestLogs.new(options)
-    command.run([fixture_path("command-format.log")])
-    output.rewind
-    expected = <<-OUTPUT
+  sub_test_case(".new") do
+    def setup
+    end
+
+    def test_output
+      output = StringIO.new("output-option")
+      options = {:output => output}
+      command = GroongaQueryLog::Command::FormatRegressionTestLogs.new(options)
+      command.run([fixture_path("command-format.log")])
+      output.rewind
+      expected = <<-OUTPUT
 Command:
 select Logs
 Name: select
@@ -130,7 +134,8 @@ Arguments:
    [1, \"log message1\"],
 -  [2, \"log message2\"]]]
 +  [3, \"log message3\"]]]
-    OUTPUT
-    assert_equal(expected, output.read)
+      OUTPUT
+      assert_equal(expected, output.read)
+    end
   end
 end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20190121/3defecf0/attachment.html>


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