The naive root + path might cause cases of double slashes e.g. http://path//relative-path.
This indeed happened with the out of the box google cloud endpoints GA discovery documents.
Switch to url.resolve to solve this cases.
1. reflector the whole path/uri generation
2. fix the unit test to pass semi valid uri (one that begins with http://), non valid uris will not work
3. rename tests => test, this is the default conversation for mocha
less code for path normalization
fix minor syntax error
remove unused import
simplifies the code, less code path fix minor issues that jshint and WebStorm found.
Merge commit '3a421bb16fa5669c3578f7db8ada208d0ad75c7f'

# By Burcu Dogan
# Via Burcu Dogan
* commit '3a421bb16fa5669c3578f7db8ada208d0ad75c7f':
  Testing request replays on auth failures for OAuth 2 client.
  Discovery should honor top level methods.
Merge pull request #109 from erlichmen/master

The naive root + path might cause cases of double slashes e.g. http://path//relative-path.