diff options
Diffstat (limited to 'deps/npm/node_modules/github-url-from-git/test.js')
-rw-r--r-- | deps/npm/node_modules/github-url-from-git/test.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/deps/npm/node_modules/github-url-from-git/test.js b/deps/npm/node_modules/github-url-from-git/test.js new file mode 100644 index 00000000000..e472302a00b --- /dev/null +++ b/deps/npm/node_modules/github-url-from-git/test.js @@ -0,0 +1,40 @@ + +var parse = require('./'); +var assert = require('better-assert'); + +describe('parse(url)', function(){ + it('should support git://*', function(){ + var url = 'git://github.com/jamesor/mongoose-versioner'; + parse(url).should.equal('https://github.com/jamesor/mongoose-versioner'); + }) + + it('should support git://*.git', function(){ + var url = 'git://github.com/treygriffith/cellar.git'; + parse(url).should.equal('https://github.com/treygriffith/cellar'); + }) + + it('should support https://*', function(){ + var url = 'https://github.com/Empeeric/i18n-node'; + parse(url).should.equal('https://github.com/Empeeric/i18n-node'); + }) + + it('should support https://*.git', function(){ + var url = 'https://jpillora@github.com/banchee/tranquil.git'; + parse(url).should.equal('https://github.com/banchee/tranquil'); + }) + + it('should return undefined on failure', function(){ + var url = 'git://github.com/justgord/.git'; + assert(null == parse(url)); + }) + + it('should parse git@gist urls', function() { + var url = 'git@gist.github.com:3135914.git'; + parse(url).should.equal('https://gist.github.com/3135914') + }) + + it('should parse https://gist urls', function() { + var url = 'https://gist.github.com/3135914.git'; + parse(url).should.equal('https://gist.github.com/3135914') + }) +}) |