Skip to content

Commit

Permalink
Add test for create_index_clause
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmire committed Aug 6, 2012
1 parent 6c80a22 commit b998bf8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/cassandra_test.rb
Expand Up @@ -962,6 +962,27 @@ def test_get_indexed_slices_with_IndexClause_objects
# <- can't test which keys are present since it's going to be random
end

def test_create_index_clause
ie = CassandraThrift::IndexExpression.new(
:column_name => 'foo',
:value => 'x',
:op => '=='
)

ic = @twitter.create_index_clause([ie], 'aaa', 250)
assert_instance_of CassandraThrift::IndexClause, ic
assert_equal 'aaa', ic.start_key
assert_equal ie, ic.expressions[0]
assert_equal 250, ic.count

# test alias
ic = @twitter.create_idx_clause([ie], 'aaa', 250)
assert_instance_of CassandraThrift::IndexClause, ic
assert_equal 'aaa', ic.start_key
assert_equal ie, ic.expressions[0]
assert_equal 250, ic.count
end

def test_column_family_mutation
k = key

Expand Down

0 comments on commit b998bf8

Please sign in to comment.