Sha256: 4c287b30d9c018a5add34048f4c574ca359e85ad564cf4c0d76b992eef8ece06
Contents?: true
Size: 1.04 KB
Versions: 14
Compression:
Stored size: 1.04 KB
Contents
require 'spec_helper' require 'image_optim/bin_resolver/comparable_condition' describe ImageOptim::BinResolver::ComparableCondition do let(:is){ ImageOptim::BinResolver::ComparableCondition.is } it 'builds conditions' do expect(is.between?(10, 20).method).to eq(:between?) expect(is.between?(10, 20).args).to eq([10, 20]) expect((is >= 15).method).to eq(:>=) expect((is >= 15).args).to eq([15]) expect((is < 30).method).to eq(:<) expect((is < 30).args).to eq([30]) end it 'stringifies conditions' do expect(is.between?(10, 20).to_s).to eq('10..20') expect((is >= 15).to_s).to eq('>= 15') expect((is < 30).to_s).to eq('< 30') end it 'matches conditions' do expect(is.between?(10, 20)).not_to match 9 expect(is.between?(10, 20)).to match 15 expect(is.between?(10, 20)).not_to match 21 expect(is >= 15).not_to match 14 expect(is >= 15).to match 15 expect(is >= 15).to match 16 expect(is < 30).to match 29 expect(is < 30).not_to match 30 expect(is < 30).not_to match 31 end end
Version data entries
14 entries across 14 versions & 2 rubygems