Sha256: 737e0953d4741bed028a6f82a84be9e1cda1525fac6655a41a77c0a7f208320c
Contents?: true
Size: 566 Bytes
Versions: 16
Compression:
Stored size: 566 Bytes
Contents
require 'uri' require 'murlsh' describe Murlsh::URIDomain do def uri_domain(s); URI(s).extend(Murlsh::URIDomain).domain; end it 'should have its domain set to the domain of its URI if it is a valid HTTP URI' do uri_domain('http://foo.com/').should == 'foo.com' end it 'should have its domain set nil if it is not a valid HTTP URI' do uri_domain('foo').should be_nil uri_domain('http://foo.bar/').should be_nil end it 'should handle two letter top-level domains' do uri_domain('http://www.linux.fm/').should == 'linux.fm' end end
Version data entries
16 entries across 16 versions & 1 rubygems