split urls
We all know URLs, http://www.meteogroup.com/en/gb/about-us/careers.html is a popular one.
Develop a class that decomposes a given URL into its constituents. For example, from the above url, we would like to get the result:
The protocol: "http" The domain name: " www.meteogroup.com" The path: “en/gb/about-us/careers.html”
Here are some example tests you could write to design this functionality: "http://some.thing" should give protocol=="http" "ftp://a.large.site" should give domain=="a.large.site" "http://a.site.with/a-path" should give path=="a-path"
What other cases can you think of?