I am running rspec tests which include data in db Cassandra. What is the best practice here for cleaning / cleaning db between tests? For my mongo data, I am using DatabaseCleaner and looking for the equivalent of Cassandra. I am doing the following in my spec_helper.rb right now, but it is very slow, so I am looking for a better solution. Thanks!
config.before :each do ['column1', 'column2'].each do |name| begin $cassandra.drop_column_family(name) rescue next ensure cf = Cassandra::ColumnFamily.new(keyspace: 'db_name', name: name, comparator_type: 'TimeUUIDType') $cassandra.add_column_family(cf) end end
source share