Kouhei Sutou
null+****@clear*****
Sat Jul 19 21:15:35 JST 2014
Kouhei Sutou 2014-07-19 21:15:35 +0900 (Sat, 19 Jul 2014) New Revision: 80b9403252abd115fed3555eb304da6646131f82 https://github.com/droonga/droonga-engine/commit/80b9403252abd115fed3555eb304da6646131f82 Message: Use Address#== Modified files: test/unit/test_address.rb Modified: test/unit/test_address.rb (+11 -5) =================================================================== --- test/unit/test_address.rb 2014-07-19 21:13:54 +0900 (5d83df0) +++ test/unit/test_address.rb 2014-07-19 21:15:35 +0900 (6d118fa) @@ -16,24 +16,30 @@ require "droonga/address" class AddressTest < Test::Unit::TestCase + def address(host, port, tag, name) + Droonga::Address.new(:host => host, + :port => port, + :tag => tag, + :name => name) + end + class ParseTest < self def parse(string) - address = Droonga::Address.parse(string) - address.to_a + Droonga::Address.parse(string) end def test_full - assert_equal(["192.168.0.1", 2929, "droonga", "name"], + assert_equal(address("192.168.0.1", 2929, "droonga", "name"), parse("192.168.0.1:2929/droonga.name")) end def test_internal_name - assert_equal(["192.168.0.1", 2929, "droonga", "#1"], + assert_equal(address("192.168.0.1", 2929, "droonga", "#1"), parse("192.168.0.1:2929/droonga.\#1")) end def test_no_name - assert_equal(["192.168.0.1", 2929, "droonga", nil], + assert_equal(address("192.168.0.1", 2929, "droonga", nil), parse("192.168.0.1:2929/droonga")) end end -------------- next part -------------- HTML����������������������������...Download