Sha256: 4b69cba49af0d9a95d3acf00bc525553defbbf081fb3a7a1c8c65a9942809ee2

Contents?: true

Size: 574 Bytes

Versions: 1

Compression:

Stored size: 574 Bytes

Contents

require 'spec_helper'

describe UrlRegexp::Host do
  subject { described_class.new }

  describe '#to_regexp_s' do
    context 'single host' do
      it 'returns regexp string' do
        subject.append('www.example.com')
        expect(subject.to_regexp_s).to eq 'www\\.example\\.com'
      end
    end
    context 'multiple hosts' do
      it 'returns regexp string' do
        subject.append('www.example1.com')
        subject.append('www.example2.com')
        expect(subject.to_regexp_s).to eq '(www\\.example1\\.com|www\\.example2\\.com)'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
url_regexp-0.1.4 spec/url_regexp/host_spec.rb