- Addressable::URI when created with a non-numeric port number
- should raise an error
- Addressable::URI when created with a scheme but no hierarchical segment
- should raise an error
- Addressable::URI when created from nil components
- should have an empty path
- should be an empty uri
- Addressable::URI when created from string components
- should be equal to the equivalent parsed URI
- Addressable::URI when created with a nil host but non-nil authority components
- should raise an error
- Addressable::URI when created with a path that hasn't been prefixed with a '/' but a host specified
- should prefix a '/' to the path
- Addressable::URI when created with a path that hasn't been prefixed with a '/' but no host specified
- should prefix a '/' to the path
- Addressable::URI when parsed from 'ftp://ftp.is.co.za/rfc/rfc1808.txt'
- should use the 'ftp' scheme
- should be considered to be ip-based
- should have a host of 'ftp.is.co.za'
- should have a path of '/rfc/rfc1808.txt'
- should be considered to be in normal form
- Addressable::URI when parsed from 'http://www.ietf.org/rfc/rfc2396.txt'
- should use the 'http' scheme
- should be considered to be ip-based
- should have a host of 'www.ietf.org'
- should have a path of '/rfc/rfc2396.txt'
- should be considered to be in normal form
- Addressable::URI when parsed from 'ldap://[2001:db8::7]/c=GB?objectClass?one'
- should use the 'ldap' scheme
- should be considered to be ip-based
- should have a host of '[2001:db8::7]'
- should have a path of '/c=GB'
- should have a query of 'objectClass?one'
- should be considered to be in normal form
- Addressable::URI when parsed from 'mailto:John.Doe@example.com'
- should use the 'mailto' scheme
- should not be considered to be ip-based
- should have a path of 'John.Doe@example.com'
- should be considered to be in normal form
- Addressable::URI when parsed from 'news:comp.infosystems.www.servers.unix'
- should use the 'news' scheme
- should not be considered to be ip-based
- should have a path of 'comp.infosystems.www.servers.unix'
- should be considered to be in normal form
- Addressable::URI when parsed from 'tel:+1-816-555-1212'
- should use the 'tel' scheme
- should not be considered to be ip-based
- should have a path of '+1-816-555-1212'
- should be considered to be in normal form
- Addressable::URI when parsed from 'telnet://192.0.2.16:80/'
- should use the 'telnet' scheme
- should have a host of '192.0.2.16'
- should have a port of '80'
- should be considered to be ip-based
- should have a path of '/'
- should be considered to be in normal form
- Addressable::URI when parsed from 'urn:oasis:names:specification:docbook:dtd:xml:4.1.2'
- should use the 'urn' scheme
- should not be considered to be ip-based
- should have a path of 'oasis:names:specification:docbook:dtd:xml:4.1.2'
- should be considered to be in normal form
- Addressable::URI when parsed from 'http://example.com'
- when inspected, should have the correct URI
- when inspected, should have the correct class name
- when inspected, should have the correct object id
- should use the 'http' scheme
- should be considered to be ip-based
- should have an authority segment of 'example.com'
- should have a host of 'example.com'
- should be considered ip-based
- should have no username
- should have no password
- should use port 80
- should not have a specified port
- should have an empty path
- should have no query string
- should have no fragment
- should be considered absolute
- should not be considered relative
- should not be exactly equal to 42
- should not be equal to 42
- should not be roughly equal to 42
- should be exactly equal to http://example.com
- should be roughly equal to http://example.com/
- should be roughly equal to the string 'http://example.com/'
- should not be roughly equal to the string 'http://example.com:bogus/'
- should result in itself when merged with itself
- should be equivalent to http://example.com/
- should be equivalent to http://example.com:/
- should be equivalent to http://example.com:80/
- should be equivalent to http://EXAMPLE.COM/
- should have a route of '/path/' to 'http://example.com/path/'
- should have a route of '/' from 'http://example.com/path/'
- should have a route of '#' to 'http://example.com/'
- should have a route of 'http://elsewhere.com/' to 'http://elsewhere.com/'
- when joined with 'relative/path' should be 'http://example.com/relative/path'
- should have the correct username after assignment
- should have the correct password after assignment
- should have the correct user/pass after repeated assignment
- should have the correct user/pass after userinfo assignment
- should correctly convert to a hash
- should be identical to its duplicate
- Addressable::URI when parsed from 'http://example.com/'
- should be equivalent to http://example.com
- should be equivalent to HTTP://example.com/
- should be equivalent to http://example.com:/
- should be equivalent to http://example.com:80/
- should be equivalent to http://Example.com/
- should have the correct username after assignment
- should have the correct password after assignment
- should correctly convert to a hash
- should be identical to its duplicate
- should have the same hash as its duplicate
- should have a different hash from its equivalent String value
- should have the same hash as an equivalent URI
- Addressable::URI when parsed from 'http://@example.com/'
- should be equivalent to http://example.com
- should correctly convert to a hash
- should be identical to its duplicate
- Addressable::URI when parsed from 'http://example.com./'
- should be equivalent to http://example.com
- should not be considered to be in normal form
- should be identical to its duplicate
- Addressable::URI when parsed from 'http://:@example.com/'
- should be equivalent to http://example.com
- should correctly convert to a hash
- should be identical to its duplicate
- Addressable::URI when parsed from 'http://example.com/~smith/'
- should be equivalent to http://example.com/%7Esmith/
- should be equivalent to http://example.com/%7esmith/
- should be identical to its duplicate
- Addressable::URI when parsed from 'http://example.com/%C3%87'
- should be equivalent to 'http://example.com/C%CC%A7'
- should not change if encoded with the normalizing algorithm
- if percent encoded should be 'http://example.com/C%25CC%25A7'
- should be identical to its duplicate
- Addressable::URI when parsed from 'http://example.com/?q=string'
- should use the 'http' scheme
- should have an authority segment of 'example.com'
- should have a host of 'example.com'
- should have no username
- should have no password
- should use port 80
- should have a path of '/'
- should have a query string of 'q=string'
- should have no fragment
- should be considered absolute
- should not be considered relative
- should be considered to be in normal form
- should be identical to its duplicate
- Addressable::URI when parsed from 'http://example.com:80/'
- should use the 'http' scheme
- should have an authority segment of 'example.com:80'
- should have a host of 'example.com'
- should have no username
- should have no password
- should use port 80
- should have a path of '/'
- should have no query string
- should have no fragment
- should be considered absolute
- should not be considered relative
- should be exactly equal to http://example.com:80/
- should be roughly equal to http://example.com/
- should be roughly equal to the string 'http://example.com/'
- should not be roughly equal to the string 'http://example.com:bogus/'
- should result in itself when joined with itself
- should be equal to http://example.com/
- should be equal to http://example.com:/
- should be equal to http://example.com:80/
- should be equal to http://EXAMPLE.COM/
- should correctly convert to a hash
- should be identical to its duplicate
- Addressable::URI when parsed from 'http://example.com:8080/'
- should use the 'http' scheme
- should have an authority segment of 'example.com:8080'
- should have a host of 'example.com'
- should have no username
- should have no password
- should use port 8080
- should have a path of '/'
- should have no query string
- should have no fragment
- should be considered absolute
- should not be considered relative
- should be exactly equal to http://example.com:8080/
- should have a route of 'http://example.com:8080/' from 'http://example.com/path/to/'
- should have a route of 'http://example.com:8080/' from 'http://example.com:80/path/to/'
- should have a route of '/' from 'http://example.com:8080/path/to/'
- should have a route of 'http://example.com:8080/' from 'http://user:pass@example.com/path/to/'
- should correctly convert to a hash
- should be identical to its duplicate
- Addressable::URI when parsed from 'http://example.com/path/to/resource/'
- should use the 'http' scheme
- should have an authority segment of 'example.com'
- should have a host of 'example.com'
- should have no username
- should have no password
- should use port 80
- should have a path of '/path/to/resource/'
- should have no query string
- should have no fragment
- should be considered absolute
- should not be considered relative
- should be exactly equal to http://example.com:8080/
- should have a route of 'resource/' from 'http://example.com/path/to/'
- should have a route of 'resource/' from 'http://example.com:80/path/to/'
- should have a route of 'http://example.com/path/to/' from 'http://example.com:8080/path/to/'
- should have a route of 'http://example.com/path/to/' from 'http://user:pass@example.com/path/to/'
- should have a route of '/path/to/resource/' from 'http://example.com/to/resource/'
- should correctly convert to a hash
- should be identical to its duplicate
- Addressable::URI when parsed from 'relative/path/to/resource'
- should not have a scheme
- should not be considered ip-based
- should not have an authority segment
- should not have a host
- should have no username
- should have no password
- should not have a port
- should have a path of 'relative/path/to/resource'
- should have no query string
- should have no fragment
- should not be considered absolute
- should be considered relative
- should raise an error if routing is attempted
- when joined with 'another/relative/path' should be 'relative/path/to/another/relative/path'
- should be identical to its duplicate
- Addressable::URI when parsed from 'relative_path_with_no_slashes'
- should not have a scheme
- should not be considered ip-based
- should not have an authority segment
- should not have a host
- should have no username
- should have no password
- should not have a port
- should have a path of 'relative_path_with_no_slashes'
- should have no query string
- should have no fragment
- should not be considered absolute
- should be considered relative
- when joined with 'another_relative_path' should be 'another_relative_path'
- Addressable::URI when parsed from 'http://example.com/file.txt'
- should have a scheme of 'http'
- should have an authority segment of 'example.com'
- should have a host of 'example.com'
- should have no username
- should have no password
- should use port 80
- should have a path of '/file.txt'
- should have a basename of 'file.txt'
- should have an extname of '.txt'
- should have no query string
- should have no fragment
- Addressable::URI when parsed from 'http://example.com/file.txt;parameter'
- should have a scheme of 'http'
- should have an authority segment of 'example.com'
- should have a host of 'example.com'
- should have no username
- should have no password
- should use port 80
- should have a path of '/file.txt;parameter'
- should have a basename of 'file.txt'
- should have an extname of '.txt'
- should have no query string
- should have no fragment
- Addressable::URI when parsed from 'http://example.com/file.txt;x=y'
- should have a scheme of 'http'
- should have a scheme of 'http'
- should have an authority segment of 'example.com'
- should have a host of 'example.com'
- should have no username
- should have no password
- should use port 80
- should have a path of '/file.txt;x=y'
- should have an extname of '.txt'
- should have no query string
- should have no fragment
- should be considered to be in normal form
- Addressable::URI when parsed from 'mailto:user@example.com'
- should have a scheme of 'mailto'
- should not be considered to be ip-based
- should have a path of 'user@example.com'
- should have no user
- should be considered to be in normal form
- Addressable::URI when parsed from 'tag:example.com,2006-08-18:/path/to/something'
- should have a scheme of 'tag'
- should be considered to be ip-based
- should have a path of 'example.com,2006-08-18:/path/to/something'
- should have no user
- should be considered to be in normal form
- Addressable::URI when parsed from 'http://example.com/x;y/'
- should be considered to be in normal form
- Addressable::URI when parsed from 'http://example.com/?x=1&y=2'
- should be considered to be in normal form
- Addressable::URI when parsed from 'view-source:http://example.com/'
- should have a scheme of 'view-source'
- should have a path of 'http://example.com/'
- should be considered to be in normal form
- Addressable::URI when parsed from 'http://user:pass@example.com/path/to/resource?query=x#fragment'
- should use the 'http' scheme
- should have an authority segment of 'user:pass@example.com'
- should have a username of 'user'
- should have a password of 'pass'
- should have a host of 'example.com'
- should use port 80
- should have a path of '/path/to/resource'
- should have a query string of 'query=x'
- should have a fragment of 'fragment'
- should be considered to be in normal form
- should have a route of '/path/' to 'http://user:pass@example.com/path/'
- should have a route of '/path/to/resource?query=x#fragment' from 'http://user:pass@example.com/path/'
- should have a route of '?query=x#fragment' from 'http://user:pass@example.com/path/to/resource'
- should have a route of '#fragment' from 'http://user:pass@example.com/path/to/resource?query=x'
- should have a route of '#fragment' from 'http://user:pass@example.com/path/to/resource?query=x#fragment'
- should have a route of 'http://elsewhere.com/' to 'http://elsewhere.com/'
- should have a route of 'http://user:pass@example.com/path/to/resource?query=x#fragment' from 'http://example.com/path/to/'
- should have the correct scheme after assignment
- should have the correct authority segment after assignment
- should have the correct userinfo segment after assignment
- should have the correct username after assignment
- should have the correct password after assignment
- should have the correct host after assignment
- should have the correct port after assignment
- should have the correct path after assignment
- should have the correct path after nil assignment
- should have the correct query string after assignment
- should have the correct query string after hash assignment
- should have the correct query string after flag hash assignment
- should have the correct fragment after assignment
- should be identical to its duplicate
- Addressable::URI when parsed from 'http://user@example.com'
- should use the 'http' scheme
- should have a username of 'user'
- should have no password
- should have a host of 'example.com'
- should use port 80
- should have the correct username after assignment
- should have the correct password after assignment
- should have the correct userinfo segment after assignment
- should have the correct userinfo segment after nil assignment
- should have the correct authority segment after assignment
- should raise an error after nil assignment of authority segment
- Addressable::URI when parsed from 'http://user:@example.com'
- should use the 'http' scheme
- should have a username of 'user'
- should have a password of ''
- should have a host of 'example.com'
- should use port 80
- should have the correct username after assignment
- should have the correct password after assignment
- should have the correct authority segment after assignment
- Addressable::URI when parsed from 'http://:pass@example.com'
- should use the 'http' scheme
- should have a username of ''
- should have a password of 'pass'
- should have a userinfo of ':pass'
- should have a host of 'example.com'
- should use port 80
- should have the correct username after assignment
- should have the correct password after assignment
- should have the correct authority segment after assignment
- Addressable::URI when parsed from 'http://:@example.com'
- should use the 'http' scheme
- should have a username of ''
- should have a password of ''
- should have a host of 'example.com'
- should use port 80
- should have the correct username after assignment
- should have the correct password after assignment
- should have the correct authority segment after assignment
- Addressable::URI when parsed from '#example'
- should be considered relative
- should have a host of nil
- should have a path of ''
- should have a query string of nil
- should have a fragment of 'example'
- Addressable::URI when parsed from the network-path reference '//example.com/'
- should be considered relative
- should have a host of 'example.com'
- should have a path of '/'
- should raise an error if routing is attempted
- Addressable::URI when parsed from 'feed://http://example.com/'
- should have a host of 'http'
- should have a path of '//example.com/'
- Addressable::URI when parsed from 'feed:http://example.com/'
- should have a path of 'http://example.com/'
- should normalize to 'http://example.com/'
- Addressable::URI when parsed from 'example://a/b/c/%7Bfoo%7D'
- should be equivalent to eXAMPLE://a/./b/../b/%63/%7bfoo%7d
- Addressable::URI when parsed from 'http://example.com/indirect/path/./to/../resource/'
- should use the 'http' scheme
- should have a host of 'example.com'
- should use port 80
- should have a path of '/indirect/path/./to/../resource/'
- should have a normalized path of '/indirect/path/resource/'
- Addressable::URI when parsed from 'http://under_score.example.com/'
- should not cause an error
- Addressable::URI when parsed from './this:that'
- should be considered relative
- should have no scheme
- Addressable::URI when parsed from 'this:that'
- should be considered absolute
- should have a scheme of 'this'
- Addressable::URI when parsed from 'http://www.詹姆斯.com/'
- should be equivalent to 'http://www.xn--8ws00zhy3a.com/'
- should not have domain name encoded during normalization
- Addressable::URI when parsed from 'http://www.詹姆斯.com/ some spaces /'
- should be equivalent to 'http://www.xn--8ws00zhy3a.com/%20some%20spaces%20/'
- should not have domain name encoded during normalization
- Addressable::URI when parsed from 'http://www.xn--8ws00zhy3a.com/'
- should be displayed as http://www.詹姆斯.com/
- Addressable::URI when parsed from 'http://www.詹姆斯.com/atomtests/iri/詹.html'
- should normalize to http://www.xn--8ws00zhy3a.com/atomtests/iri/%E8%A9%B9.html
- Addressable::URI with a base uri of 'http://a/b/c/d;p?q'
- when joined with 'g:h' should resolve to g:h
- when joined with 'g' should resolve to http://a/b/c/g
- when joined with './g' should resolve to http://a/b/c/g
- when joined with 'g/' should resolve to http://a/b/c/g/
- when joined with '/g' should resolve to http://a/g
- when joined with '//g' should resolve to http://g
- when joined with '?y' should resolve to http://a/b/c/d;p?y
- when joined with 'g?y' should resolve to http://a/b/c/g?y
- when joined with '#s' should resolve to http://a/b/c/d;p?q#s
- when joined with 'g#s' should resolve to http://a/b/c/g#s
- when joined with 'g?y#s' should resolve to http://a/b/c/g?y#s
- when joined with ';x' should resolve to http://a/b/c/;x
- when joined with 'g;x' should resolve to http://a/b/c/g;x
- when joined with 'g;x?y#s' should resolve to http://a/b/c/g;x?y#s
- when joined with '' should resolve to http://a/b/c/d;p?q
- when joined with '.' should resolve to http://a/b/c/
- when joined with './' should resolve to http://a/b/c/
- when joined with '..' should resolve to http://a/b/
- when joined with '../' should resolve to http://a/b/
- when joined with '../g' should resolve to http://a/b/g
- when joined with '../..' should resolve to http://a/
- when joined with '../../' should resolve to http://a/
- when joined with '../../g' should resolve to http://a/g
- when joined with '../../../g' should resolve to http://a/g
- when joined with '../.././../g' should resolve to http://a/g
- when joined with '../../../../g' should resolve to http://a/g
- when joined with '/./g' should resolve to http://a/g
- when joined with '/../g' should resolve to http://a/g
- when joined with 'g.' should resolve to http://a/b/c/g.
- when joined with '.g' should resolve to http://a/b/c/.g
- when joined with 'g..' should resolve to http://a/b/c/g..
- when joined with '..g' should resolve to http://a/b/c/..g
- when joined with './../g' should resolve to http://a/b/g
- when joined with './g/.' should resolve to http://a/b/c/g/
- when joined with 'g/./h' should resolve to http://a/b/c/g/h
- when joined with 'g/../h' should resolve to http://a/b/c/h
- when joined with 'g;x=1/./y' should resolve to http://a/b/c/g;x=1/y
- when joined with 'g;x=1/../y' should resolve to http://a/b/c/y
- when joined with 'g?y/./x' should resolve to http://a/b/c/g?y/./x
- when joined with 'g?y/../x' should resolve to http://a/b/c/g?y/../x
- when joined with 'g#s/./x' should resolve to http://a/b/c/g#s/./x
- when joined with 'g#s/../x' should resolve to http://a/b/c/g#s/../x
- when joined with 'http:g' should resolve to http:g
- when joined with '//example.com/' should resolve to http://example.com/
- Addressable::URI::IDNA without libidn bindings
- should raise an exception when an operation is attempted
- should not cause normalization routines to error out
- should not cause display uri routines to error out
- Addressable::URI::IDNA with rubygems and idn missing
- should not raise an exception while checking if libidn is available
- should not cause normalization routines to error out
- should not cause display uri routines to error out
- Addressable::URI when extracting from an arbitrary text
- should have all obvious URIs extractable from it
- Addressable::URI when extracting from an arbitrary text containing invalid URIs
- should ignore invalid URIs when extracting
- Addressable::URI when converting the path 'relative/path/to/something'
- should convert to 'relative/path/to/something'
- Addressable::URI when given the root directory
- should convert to 'file:///'
- Addressable::URI when given the path '/home/user/'
- should convert to 'file:///home/user/'
- Addressable::URI when given the path 'c:\windows\My Documents 100%20\foo.txt'
- should convert to 'file:///c:/windows/My%20Documents%20100%20/foo.txt'
- Addressable::URI when given the path 'file://c:\windows\My Documents 100%20\foo.txt'
- should convert to 'file:///c:/windows/My%20Documents%20100%20/foo.txt'
- Addressable::URI when given the path 'file:///c|/windows/My%20Documents%20100%20/foo.txt'
- should convert to 'file:///c:/windows/My%20Documents%20100%20/foo.txt'
- Addressable::URI when given an http protocol URI
- should not do any conversion at all
- Addressable::URI when given the template pattern 'http://example.com/search/{query}/' to be processed with the ExampleProcessor
- should expand to 'http://example.com/search/an+example+search+query/' with a mapping of {"query" => "an example search query"}
- should raise an error with a mapping of {"query" => "invalid!"}
- Addressable::URI when given the mapping supplied in Section 3.3.1 of the URI Template draft
- should result in 'http://example.org/page1#fred' when used to expand 'http://example.org/page1#{a}'
- should result in 'http://example.org/fred/barney/' when used to expand 'http://example.org/{a}/{b}/'
- should result in 'http://example.org/fredbarney/' when used to expand 'http://example.org/{a}{b}/'
- should result in 'http://example.com/order/cheeseburger/cheeseburger/cheeseburger/' when used to expand 'http://example.com/order/{c}/{c}/{c}/'
- should result in 'http://example.org/one%20two%20three' when used to expand 'http://example.org/{d}'
- should result in 'http://example.org/20%25%20tricky' when used to expand 'http://example.org/{e}'
- should result in 'http://example.com//' when used to expand 'http://example.com/{f}/'
- should result in 'https://this-is-spinal-tap.example.org?date=&option=fred' when used to expand '{scheme}://{20}.example.org?date={wilma}&option={a}'
- should result in 'http://example.org?quote=to+be+or+not+to+be' when used to expand 'http://example.org?{p}'
- should result in 'http://example.com/hullo#world' when used to expand 'http://example.com/{q}'
- Addressable::URI when given a mapping that contains a template-var within a value
- should result in 'http://example.com/%7Bb%7D/barney/' when used to expand 'http://example.com/{a}/{b}/'
- Addressable::URI when given a mapping that contains values that are already percent-encoded
- should result in 'http://example.com/%257Bb%257D/' when used to expand 'http://example.com/{a}/'
- Addressable::URI when parsed from '/'
- should have the correct mapping when extracting values using the pattern '/'
- Addressable::URI when parsed from '/one/'
- should not match the pattern '/two/'
- should have the correct mapping when extracting values using the pattern '/{number}/'
- Addressable::URI when parsed from '/one/two/'
- should not match the pattern '/{number}/' with the SlashlessProcessor
- should have the correct mapping when extracting values using the pattern '/{number}/' without a processor
- should have the correct mapping when extracting values using the pattern '/{first}/{second}/' with the SlashlessProcessor
- Addressable::URI when parsed from 'http://example.com/search/an+example+search+query/'
- should have the correct mapping when extracting values using the pattern 'http://example.com/search/{query}/' with the ExampleProcessor
- should return nil when extracting values using a non-matching pattern
- Addressable::URI when parsed from 'http://example.com/a/b/c/'
- should have the correct mapping when extracting values using the pattern 'http://example.com/{first}/{second}/' with the ExampleProcessor
- Addressable::URI when parsed from 'http://example.com/one/spacer/two/'
- should have the correct mapping when extracting values using the pattern 'http://example.com/{first}/spacer/{second}/'
- Addressable::URI when given the input '/path/to/resource'
- should heuristically parse to '/path/to/resource'
- Addressable::URI when given the input 'relative/path/to/resource'
- should heuristically parse to 'relative/path/to/resource'
- Addressable::URI when given the input 'example.com'
- should heuristically parse to 'http://example.com'
- Addressable::URI when given the input 'example.com' and a scheme hint of 'ftp'
- should heuristically parse to 'http://example.com'
- Addressable::URI when given the input 'example.com:21' and a scheme hint of 'ftp'
- should heuristically parse to 'http://example.com:21'
- Addressable::URI when given the input 'example.com/path/to/resource'
- should heuristically parse to 'http://example.com/path/to/resource'
- Addressable::URI when given the input 'http:///example.com'
- should heuristically parse to 'http://example.com'
- Addressable::URI when given the input 'feed:///example.com'
- should heuristically parse to 'feed://example.com'
- Addressable::URI when given the input 'file://path/to/resource/'
- should heuristically parse to 'file:///path/to/resource/'
- Addressable::URI when given the input 'feed://http://example.com'
- should heuristically parse to 'feed:http://example.com'