YUKI Hiroshi
null+****@clear*****
Fri May 9 11:33:43 JST 2014
YUKI Hiroshi 2014-05-09 11:33:43 +0900 (Fri, 09 May 2014) New Revision: 79ee3e4bacaaf4cefc670402d3e84734c1716034 https://github.com/droonga/droonga-engine/commit/79ee3e4bacaaf4cefc670402d3e84734c1716034 Message: Add tests for "all_nodes" method Modified files: test/unit/catalog/test_collection_volume.rb test/unit/catalog/test_single_volume.rb Modified: test/unit/catalog/test_collection_volume.rb (+16 -0) =================================================================== --- test/unit/catalog/test_collection_volume.rb 2014-05-09 11:20:25 +0900 (d0f283d) +++ test/unit/catalog/test_collection_volume.rb 2014-05-09 11:33:43 +0900 (8cef68f) @@ -100,4 +100,20 @@ class CatalogSingleVolumeTest < Test::Unit::TestCase end end end + + class NodesTest < self + def test_all_nodes + data = { + "slices" => [ + { "volume": { "address": "127.0.0.1:23003/droonga.000" } }, + { "volume": { "address": "127.0.0.1:23003/droonga.001" } }, + { "volume": { "address": "127.0.0.1:23004/droonga.100" } }, + { "volume": { "address": "127.0.0.1:23004/droonga.101" } }, + ], + } + volume = create_collection_volume(data) + assert_equal(["127.0.0.1:23003", "127.0.0.1:23004"], + volume.all_nodes) + end + end end Modified: test/unit/catalog/test_single_volume.rb (+9 -0) =================================================================== --- test/unit/catalog/test_single_volume.rb 2014-05-09 11:20:25 +0900 (cabf25a) +++ test/unit/catalog/test_single_volume.rb 2014-05-09 11:33:43 +0900 (9fe13bd) @@ -28,4 +28,13 @@ class CatalogSingleVolumeTest < Test::Unit::TestCase assert_equal("127.0.0.1:10047/volume.000", volume.address) end + + def test_all_nodes + data = { + "address" => "127.0.0.1:10047/volume.000", + } + volume = create_single_volume(data) + assert_equal(["127.0.0.1:10047"], + volume.all_nodes) + end end -------------- next part -------------- HTML����������������������������...下載