@@ -34,7 +34,7 @@ module Cassandra
3434 promise = double ( 'promise' )
3535 statement = double ( 'simple statement' )
3636
37- expect ( Statements ::Simple ) . to receive ( :new ) . once . with ( cql , EMPTY_LIST ) . and_return ( statement )
37+ expect ( Statements ::Simple ) . to receive ( :new ) . once . with ( cql , EMPTY_LIST , EMPTY_LIST ) . and_return ( statement )
3838 expect ( client ) . to receive ( :query ) . once . with ( statement , session_options ) . and_return ( promise )
3939 expect ( session . execute_async ( cql ) ) . to eq ( promise )
4040 end
@@ -47,12 +47,25 @@ module Cassandra
4747 promise = double ( 'promise' )
4848 statement = double ( 'simple statement' )
4949
50- expect ( Statements ::Simple ) . to receive ( :new ) . once . with ( cql , [ 1 ] ) . and_return ( statement )
50+ expect ( Statements ::Simple ) . to receive ( :new ) . once . with ( cql , [ 1 ] , [ ] ) . and_return ( statement )
5151 expect ( client ) . to receive ( :query ) . once . with ( statement , session_options . override ( arguments : [ 1 ] ) ) . and_return ( promise )
5252 expect ( session . execute_async ( cql , arguments : [ 1 ] ) ) . to eq ( promise )
5353 end
5454 end
5555
56+ context 'with arguments and type_hints' do
57+ let ( :cql ) { 'SELECT * FROM songs WHERE id = ?' }
58+
59+ it 'sends query with a simple statement with parameters and type hints' do
60+ promise = double ( 'promise' )
61+ statement = double ( 'simple statement' )
62+
63+ expect ( Statements ::Simple ) . to receive ( :new ) . once . with ( cql , [ 1 ] , [ :int ] ) . and_return ( statement )
64+ expect ( client ) . to receive ( :query ) . once . with ( statement , session_options . override ( arguments : [ 1 ] , type_hints : [ :int ] ) ) . and_return ( promise )
65+ expect ( session . execute_async ( cql , arguments : [ 1 ] , type_hints : [ :int ] ) ) . to eq ( promise )
66+ end
67+ end
68+
5669 context 'with options' do
5770 let ( :cql ) { 'SELECT * FROM songs' }
5871 let ( :options ) { { :trace => true } }
@@ -61,7 +74,7 @@ module Cassandra
6174 promise = double ( 'promise' )
6275 statement = double ( 'simple statement' )
6376
64- expect ( Statements ::Simple ) . to receive ( :new ) . once . with ( cql , EMPTY_LIST ) . and_return ( statement )
77+ expect ( Statements ::Simple ) . to receive ( :new ) . once . with ( cql , EMPTY_LIST , EMPTY_LIST ) . and_return ( statement )
6578 expect ( client ) . to receive ( :query ) . once . with ( statement , session_options . override ( options ) ) . and_return ( promise )
6679 expect ( session . execute_async ( cql , options ) ) . to eq ( promise )
6780 end
0 commit comments