Kouhei Sutou
null+****@clear*****
Fri Feb 28 15:26:44 JST 2014
Kouhei Sutou 2014-02-28 15:26:44 +0900 (Fri, 28 Feb 2014) New Revision: 358443d71d06be1f7d6380ebb423883bdd13e1e7 https://github.com/droonga/fluent-plugin-droonga/commit/358443d71d06be1f7d6380ebb423883bdd13e1e7 Message: test unit: follow API change Modified files: test/unit/plugins/crud/test_add.rb test/unit/plugins/groonga/test_column_create.rb test/unit/plugins/groonga/test_table_create.rb test/unit/plugins/groonga/test_table_remove.rb test/unit/plugins/test_groonga.rb test/unit/plugins/test_watch.rb Modified: test/unit/plugins/crud/test_add.rb (+1 -3) =================================================================== --- test/unit/plugins/crud/test_add.rb 2014-02-28 15:21:04 +0900 (2da59a9) +++ test/unit/plugins/crud/test_add.rb 2014-02-28 15:26:44 +0900 (aeb65e6) @@ -16,9 +16,7 @@ require "droonga/plugins/crud" class CRUDAddHandlerTest < Test::Unit::TestCase - SUCCESS_RESPONSE_BODY = { - "success" => true, - } + SUCCESS_RESPONSE_BODY = true def setup setup_database Modified: test/unit/plugins/groonga/test_column_create.rb (+0 -4) =================================================================== --- test/unit/plugins/groonga/test_column_create.rb 2014-02-28 15:21:04 +0900 (7c4f9f1) +++ test/unit/plugins/groonga/test_column_create.rb 2014-02-28 15:26:44 +0900 (0e623fc) @@ -30,8 +30,6 @@ class ColumnCreateTest < GroongaHandlerTest "type" => "ShortText", } response = process(:column_create, message) - assert_valid_output(response) - response = response["result"] assert_equal( [NORMALIZED_HEADER_SUCCESS, true], [normalize_header(response.first), response.last] @@ -45,8 +43,6 @@ class ColumnCreateTest < GroongaHandlerTest "type" => "ShortText", } response = process(:column_create, message) - assert_valid_output(response) - response = response["result"] assert_equal( [NORMALIZED_HEADER_INVALID_ARGUMENT, false], [normalize_header(response.first), response.last] Modified: test/unit/plugins/groonga/test_table_create.rb (+0 -4) =================================================================== --- test/unit/plugins/groonga/test_table_create.rb 2014-02-28 15:21:04 +0900 (b17d7df) +++ test/unit/plugins/groonga/test_table_create.rb 2014-02-28 15:26:44 +0900 (02324f0) @@ -22,8 +22,6 @@ class TableCreateTest < GroongaHandlerTest def test_success response = process(:table_create, {"name" => "Books"}) - assert_valid_output(response) - response = response["result"] assert_equal( [NORMALIZED_HEADER_SUCCESS, true], [normalize_header(response.first), response.last] @@ -32,8 +30,6 @@ class TableCreateTest < GroongaHandlerTest def test_failure response = process(:table_create, {}) - assert_valid_output(response) - response = response["result"] assert_equal( [NORMALIZED_HEADER_INVALID_ARGUMENT, false], [normalize_header(response.first), response.last] Modified: test/unit/plugins/groonga/test_table_remove.rb (+0 -4) =================================================================== --- test/unit/plugins/groonga/test_table_remove.rb 2014-02-28 15:21:04 +0900 (ff14d83) +++ test/unit/plugins/groonga/test_table_remove.rb 2014-02-28 15:26:44 +0900 (71962f1) @@ -29,8 +29,6 @@ class TableRemoveTest < GroongaHandlerTest def test_success response = process(:table_remove, {"name" => "Books"}) - assert_valid_output(response) - response = response["result"] assert_equal( [NORMALIZED_HEADER_SUCCESS, true], [normalize_header(response.first), response.last] @@ -41,8 +39,6 @@ class TableRemoveTest < GroongaHandlerTest def test_failure response = process(:table_remove, {}) - assert_valid_output(response) - response = response["result"] assert_equal( [NORMALIZED_HEADER_INVALID_ARGUMENT, false], [normalize_header(response.first), response.last] Modified: test/unit/plugins/test_groonga.rb (+0 -13) =================================================================== --- test/unit/plugins/test_groonga.rb 2014-02-28 15:21:04 +0900 (8ef5d86) +++ test/unit/plugins/test_groonga.rb 2014-02-28 15:26:44 +0900 (0add108) @@ -66,17 +66,4 @@ class GroongaHandlerTest < Test::Unit::TestCase NORMALIZED_START_TIME, NORMALIZED_ELAPSED_TIME, ] - - def assert_valid_output(output) - expected = { - "result" => [], - } - normalized_output = Marshal.load(Marshal.dump(output)) - normalized_output.each do |key, value| - if value.is_a?(Array) - normalized_output[key] = [] - end - end - assert_equal(expected, normalized_output) - end end Modified: test/unit/plugins/test_watch.rb (+1 -1) =================================================================== --- test/unit/plugins/test_watch.rb 2014-02-28 15:21:04 +0900 (9552623) +++ test/unit/plugins/test_watch.rb 2014-02-28 15:26:44 +0900 (0c066d8) @@ -20,7 +20,7 @@ require "droonga/plugins/watch" class WatchHandlerTest < Test::Unit::TestCase include WatchHelper - SUCCESS_RESULT = { "success" => true } + SUCCESS_RESULT = true def setup setup_database -------------- next part -------------- HTML����������������������������...Download