Sha256: 873a4bd669f421ecf28ef098c1f73bb8ee16cebd060d0f10844088bfd5788e54
Contents?: true
Size: 1.26 KB
Versions: 19
Compression:
Stored size: 1.26 KB
Contents
require 'fluent_plugins_spec_helper' require 'flydata/source_mysql/plugin_support/drop_table_query_handler' require 'flydata/source_mysql/plugin_support/shared_query_handler_context' module Flydata::SourceMysql::PluginSupport describe DropTableQueryHandler do include_context "query handler context" let(:query) { "DROP TABLE #{table}" } let(:normalized_query) { "DROP TABLE #{table}" } let(:subject_object) { described_class.new(context) } describe '#process' do subject { subject_object.process(record) } it 'handles a drop table event' do expect(Fluent::Engine).to receive(:emit_array).once expect(sync_fm).to receive(:increment_table_rev).with(table, 1) expect(sync_fm).to receive(:save_table_position).with(table, 200) expect(sync_fm).to receive(:save_table_source_pos).with(table, FlydataCore::Mysql::BinlogPos.infinity_src_pos, destination: :positions) subject end context 'when unsupported table is dropped' do let(:normalized_query) { "DROP TABLE bar" } it 'ignore a drop table event' do expect(Fluent::Engine).to receive(:emit_array).never expect(sync_fm).to receive(:save_table_source_pos).never subject end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems