Sha256: ea93c7de391ab567873742705953b8c630c94da50ad1e268354bb7a2dd434a42
Contents?: true
Size: 1.97 KB
Versions: 30
Compression:
Stored size: 1.97 KB
Contents
module Mysql shared_context "query handler context" do let(:database) { "testdb" } let(:table) { "foo" } let(:seq) { 200 } let(:sync_fm) do r = double('sync_fm') allow(r).to receive(:get_table_binlog_pos).and_return("mysql-bin.000065\t120") allow(r).to receive(:increment_and_save_table_position).with(table).and_yield(seq).and_return(nil) allow(r).to receive(:delete_table_binlog_pos).with(table) r end let(:table_meta) { double'table_meta' } let(:current_binlog_file) { "mysql-bin.000066" } let(:tag) { "some_tag" } let(:table_rev) { 1 } let(:flydata_record_version) { 2 } let(:context) do r = double('context') allow(r).to receive(:sync_fm).and_return(sync_fm) allow(r).to receive(:database).and_return(database) allow(r).to receive(:tables).and_return([table]) allow(r).to receive(:table_meta).and_return(table_meta) allow(r).to receive(:current_binlog_file).and_return(current_binlog_file) allow(r).to receive(:omit_events).and_return({}) allow(r).to receive(:table_revs).and_return({ table => table_rev}) allow(r).to receive(:tag).and_return(tag) r end let(:query) { "a_query" } let(:normalized_query) { double('normalized_query') } let(:event_length) { 20 } let(:next_position) { 200 } let(:timestamp) { 1427973738 } let(:record) do r = double('record') allow(r).to receive(:[]).with("db_name").and_return(database) allow(r).to receive(:[]).with("query").and_return(query) allow(r).to receive(:[]).with("table_name").and_return(table) allow(r).to receive(:[]).with("normalized_query").and_return(normalized_query) allow(r).to receive(:[]).with("next_position").and_return(next_position) allow(r).to receive(:[]).with("event_length").and_return(event_length) allow(r).to receive(:[]).with("timestamp").and_return("#{timestamp}") r end subject { described_class.new(context) } end end
Version data entries
30 entries across 30 versions & 1 rubygems