Sha256: 1d6d39a90f8e0bb8c5603d6ffdd66514cfb2d3169e09a036eee7a9c4a22a048c

Contents?: true

Size: 1.29 KB

Versions: 8

Compression:

Stored size: 1.29 KB

Contents

require 'spec_helper'

describe PublicSuffix::Domain do
  describe '#match' do
    it 'returns true' do
      expect(PublicSuffix.parse('g.com').match('g.com')).to eql true
    end

    it 'returns true' do
      expect(PublicSuffix.parse('s.g.com').match('*.g.com')).to eql true
    end

    it 'returns false' do
      expect(PublicSuffix.parse('a.b.g.com').match('*.g.com')).to eql false
    end

    it 'returns true' do
      expect(PublicSuffix.parse('a.b.g.com').match('*.b.g.com')).to eql true
    end

    it 'returns true' do
      expect(PublicSuffix.parse('a.b.g.com').match('**.g.com')).to eql true
    end

    it 'returns false' do
      expect(PublicSuffix.parse('a.b.y.g.com').match('**.b.g.com')).to eql false
    end

    it 'returns false' do
      expect(PublicSuffix.parse('w.g.com').match('*.g2.com')).to eql false
    end

    it 'returns true' do
      expect(PublicSuffix.parse('a.b.g.com').match('a.b.g.com')).to eql true
    end

    it 'returns false' do
      expect(PublicSuffix.parse('a.b.g.com').match('a.y.g.com')).to eql false
    end

    it 'returns true' do
      expect(PublicSuffix.parse('a.b.c.d.g.com').match('**.c.d.g.com')).to eql true
    end

    it 'returns true' do
      expect(PublicSuffix.parse('a.b.c.d.g.com').match('*.b.c.d.g.com')).to eql true
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cms_scanner-0.0.18 spec/lib/public_suffix/domain_spec.rb
cms_scanner-0.0.17 spec/lib/public_suffix/domain_spec.rb
cms_scanner-0.0.16 spec/lib/public_suffix/domain_spec.rb
cms_scanner-0.0.15 spec/lib/public_suffix/domain_spec.rb
cms_scanner-0.0.14 spec/lib/public_suffix/domain_spec.rb
cms_scanner-0.0.13 spec/lib/public_suffix/domain_spec.rb
cms_scanner-0.0.12 spec/lib/public_suffix/domain_spec.rb
cms_scanner-0.0.11 spec/lib/public_suffix/domain_spec.rb