Sha256: 73e3ae6f786953f6c4d5347c89703097b489ecc574a3f5e0b95704ce37daba94
Contents?: true
Size: 1.11 KB
Versions: 7
Compression:
Stored size: 1.11 KB
Contents
RSpec.describe PageMagic::Comparator::Fuzzy do describe '#fuzzy?' do context 'when one value is fuzzy' do it 'returns true' do map = described_class.new(//) expect(map).to be_fuzzy end end end describe 'match?' do context 'when comparator contains the parameter' do it 'returns true' do expect(described_class.new(/f*o/)).to be_match('foo') end end context 'when comparator does not contains the parameter' do it 'returns false' do expect(described_class.new(/f*o/)).not_to be_match('bar') end end end describe '#<=>' do context 'when other is `Null`' do it 'is lesser' do expect(described_class.new(//) <=> PageMagic::Comparator::Null.new).to be(-1) end end context 'when other is `Fuzzy`' do it 'is equal' do expect(described_class.new(//) <=> described_class.new(//)).to be 0 end end context 'when other is `Literal`' do it 'is greater' do expect(described_class.new(//) <=> PageMagic::Comparator::Literal.new('/')).to be 1 end end end end
Version data entries
7 entries across 7 versions & 1 rubygems