Navigation Menu

Skip to content

Commit

Permalink
Add more tests for parsing of valid strings
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 30, 2015
1 parent 36fc3d1 commit 66fb06f
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions test/unit/test_node_name.rb
Expand Up @@ -44,9 +44,21 @@ def parse(string)
Droonga::NodeName.parse(string)
end

def test_valid_string
assert_equal(node_name("192.168.0.1", 2929, "droonga"),
parse("192.168.0.1:2929/droonga"))
data(:ip_address => {
:input => "192.168.0.1:2929/droonga",
:host => "192.168.0.1",
:port => 2929,
:tag => "droonga",
},
:host_name => {
:input => "node29:2929/droonga",
:host => "node29",
:port => 2929,
:tag => "droonga",
})
def test_valid_string(data)
assert_equal(node_name(data[:host], data[:port], data[:tag]),
parse(data[:input]))
end

def test_instance
Expand Down

0 comments on commit 66fb06f

Please sign in to comment.