Sha256: 97727d40e482a3ecb072607880027c588a898bfde93a5e100879a9bef5413b55

Contents?: true

Size: 1.21 KB

Versions: 36

Compression:

Stored size: 1.21 KB

Contents

require 'fluent_plugins_spec_helper'
require 'flydata/mysql/binlog_position'
module Flydata
module Mysql
  describe BinLogPosition do
    let(:pos1) { BinLogPosition.new('mysql-bin.000064	107') }
    let(:pos2) { BinLogPosition.new('mysql-bin.000064	978') }
    let(:pos3) { BinLogPosition.new('mysql-bin.000065	107') }
    let(:pos4) { BinLogPosition.new('mysql-bin.000064	1107') }
    let(:pos5) { BinLogPosition.new('mysql-bin.000064	1107') }

    it 'should respond to greater than or equal to operator' do
      expect(pos1.respond_to?('>=')).to be_truthy
    end

    context 'when testing greater than or equal to operator' do
      it 'should return true when it is compared with another object with smaller position value' do
        expect(pos2 >= pos1).to be_truthy
      end

      it 'should return false when it is compared with another object with bigger binlogfile value' do
        expect(pos2 >= pos3).to be_falsey
      end 

      it 'should compare the position as an integer (and not string)' do
        expect(pos2 >= pos4).to be_falsey
      end

      it 'should return true when it is compared with another object with equal value' do
        expect(pos4 >= pos5).to be_truthy
      end
    end
  end
end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
flydata-0.6.3 spec/flydata/mysql/binlog_position_spec.rb
flydata-0.6.2 spec/flydata/mysql/binlog_position_spec.rb
flydata-0.6.1 spec/flydata/mysql/binlog_position_spec.rb
flydata-0.6.0 spec/flydata/mysql/binlog_position_spec.rb
flydata-0.5.21 spec/flydata/mysql/binlog_position_spec.rb
flydata-0.5.20 spec/flydata/mysql/binlog_position_spec.rb
flydata-0.5.17 spec/flydata/mysql/binlog_position_spec.rb
flydata-0.5.16 spec/flydata/mysql/binlog_position_spec.rb
flydata-0.5.15 spec/flydata/mysql/binlog_position_spec.rb
flydata-0.5.14 spec/flydata/mysql/binlog_position_spec.rb
flydata-0.5.13 spec/flydata/mysql/binlog_position_spec.rb
flydata-0.5.12 spec/flydata/mysql/binlog_position_spec.rb
flydata-0.5.11 spec/flydata/mysql/binlog_position_spec.rb
flydata-0.5.10 spec/flydata/mysql/binlog_position_spec.rb
flydata-0.5.9 spec/flydata/mysql/binlog_position_spec.rb
flydata-0.5.8 spec/flydata/mysql/binlog_position_spec.rb
flydata-0.5.7 spec/flydata/mysql/binlog_position_spec.rb
flydata-0.5.6 spec/flydata/mysql/binlog_position_spec.rb
flydata-0.5.5 spec/flydata/mysql/binlog_position_spec.rb
flydata-0.5.4 spec/flydata/mysql/binlog_position_spec.rb