@@ -34,6 +34,7 @@ module Cassandra
3434
3535 before do
3636 allow ( ks ) . to receive ( :name ) . and_return ( 'myks1' )
37+ allow ( ks ) . to receive ( :table ) . with ( 'table1' ) . and_return ( table )
3738 allow ( table ) . to receive ( :name ) . and_return ( 'table1' )
3839 allow ( col ) . to receive ( :name ) . and_return ( 'col' )
3940 allow ( col ) . to receive ( :type ) . and_return ( Cassandra ::Types . int )
@@ -45,7 +46,7 @@ module Cassandra
4546 end
4647
4748 it 'should quote keyspace, view name, table name, columns properly' do
48- t = MaterializedView . new ( ks , 'myview1' , [ col ] , [ ] , [ col2 , col3 ] , options , false , where , table , id )
49+ t = MaterializedView . new ( ks , 'myview1' , [ col ] , [ ] , [ col2 , col3 ] , options , false , where , 'table1' , id )
4950 expected_cql = <<-EOF
5051CREATE MATERIALIZED VIEW "myks1"."myview1" AS
5152SELECT col, "col2", "from"
@@ -58,7 +59,7 @@ module Cassandra
5859 end
5960
6061 it 'should quote primary key properly for simple partition key' do
61- t = MaterializedView . new ( ks , 'myview1' , [ col ] , [ col2 ] , [ col3 ] , options , false , where , table , id )
62+ t = MaterializedView . new ( ks , 'myview1' , [ col ] , [ col2 ] , [ col3 ] , options , false , where , 'table1' , id )
6263 expected_cql = <<-EOF
6364CREATE MATERIALIZED VIEW "myks1"."myview1" AS
6465SELECT col, "col2", "from"
@@ -71,7 +72,7 @@ module Cassandra
7172 end
7273
7374 it 'should quote primary key properly for composite partition key' do
74- t = MaterializedView . new ( ks , 'myview1' , [ col , col2 ] , [ col3 ] , [ ] , options , false , where , table , id )
75+ t = MaterializedView . new ( ks , 'myview1' , [ col , col2 ] , [ col3 ] , [ ] , options , false , where , 'table1' , id )
7576 expected_cql = <<-EOF
7677CREATE MATERIALIZED VIEW "myks1"."myview1" AS
7778SELECT col, "col2", "from"
@@ -84,7 +85,7 @@ module Cassandra
8485 end
8586
8687 it 'should handle no where-clause properly' do
87- t = MaterializedView . new ( ks , 'myview1' , [ col , col2 ] , [ col3 ] , [ ] , options , false , nil , table , id )
88+ t = MaterializedView . new ( ks , 'myview1' , [ col , col2 ] , [ col3 ] , [ ] , options , false , nil , 'table1' , id )
8889 expected_cql = <<-EOF
8990CREATE MATERIALIZED VIEW "myks1"."myview1" AS
9091SELECT col, "col2", "from"
@@ -96,7 +97,7 @@ module Cassandra
9697 end
9798
9899 it 'should handle include-all-columns properly' do
99- t = MaterializedView . new ( ks , 'myview1' , [ col , col2 ] , [ col3 ] , [ ] , options , true , nil , table , id )
100+ t = MaterializedView . new ( ks , 'myview1' , [ col , col2 ] , [ col3 ] , [ ] , options , true , nil , 'table1' , id )
100101 expected_cql = <<-EOF
101102CREATE MATERIALIZED VIEW "myks1"."myview1" AS
102103SELECT *
0 commit comments