Navigation Menu

Skip to content

Commit

Permalink
Add more tests for Cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 30, 2015
1 parent c0e379a commit f7ab57f
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions test/unit/test_cluster.rb
Expand Up @@ -104,4 +104,37 @@ def test_engine_nodes_status
},
cluster.engine_nodes_status)
end

def test_readable_nodes
cluster = create_cluster(:state => {
"node29:2929/droonga" => {
"live" => true,
"role" => Droonga::NodeRole::SERVICE_PROVIDER,
},
"node30:2929/droonga" => {
"live" => false,
"role" => Droonga::NodeRole::SERVICE_PROVIDER,
},
},
:all_nodes => [
"node29:2929/droonga",
"node30:2929/droonga",
])
assert_equal([
"node29:2929/droonga",
],
cluster.readable_nodes)
end

def test_writable_nodes
cluster = create_cluster(:all_nodes => [
"node29:2929/droonga",
"node30:2929/droonga",
])
assert_equal([
"node29:2929/droonga",
"node30:2929/droonga",
],
cluster.writable_nodes)
end
end

0 comments on commit f7ab57f

Please sign in to comment.