YUKI Hiroshi
null+****@clear*****
Thu Apr 30 12:51:26 JST 2015
YUKI Hiroshi 2015-04-30 12:51:26 +0900 (Thu, 30 Apr 2015) New Revision: b4358196e781f032e4d7f08add69bf5889635462 https://github.com/droonga/droonga-engine/commit/b4358196e781f032e4d7f08add69bf5889635462 Message: Add test for EngineNode#to_json Modified files: test/unit/test_engine_node.rb Modified: test/unit/test_engine_node.rb (+18 -0) =================================================================== --- test/unit/test_engine_node.rb 2015-04-30 12:36:22 +0900 (ca9b4ec) +++ test/unit/test_engine_node.rb 2015-04-30 12:51:26 +0900 (497caad) @@ -62,6 +62,24 @@ class EngineNodeTest < Test::Unit::TestCase :state => state).live?) end + data(:valid => { + :state => { + "live" => true, + "role" => Droonga::NodeRole::SERVICE_PROVIDER, + }, + :expected => { + "name" => "node29:2929/droonga", + "live" => true, + "role" => Droonga::NodeRole::SERVICE_PROVIDER, + "status" => "active", + }, + }) + def test_to_json(data) + json = node(:name => "node29:2929/droonga", + :state => data[:state]).to_json + assert_equal(data[:expected], json) + end + class FromServiceProvider < self class EngineNode < Droonga::EngineNode private -------------- next part -------------- HTML����������������������������...Download