You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.0 KiB

11 years ago
var assert = require("assert")
var getUrl = require("../")
describe("github url from username/repo", function () {
it("returns a github url for the username/repo", function () {
var url = getUrl("visionmedia/express")
assert.equal("git://github.com/visionmedia/express", url)
})
11 years ago
it("returns null if it does not match", function () {
var url = getUrl("package")
assert.deepEqual(null, url)
})
it("returns null if no repo/user was given", function () {
11 years ago
var url = getUrl()
assert.deepEqual(null, url)
})
it("works with .", function () {
var url = getUrl("component/downloader.js")
assert.equal("git://github.com/component/downloader.js", url)
})
it("works with . in the beginning", function () {
var url = getUrl("component/.downloader.js")
assert.equal("git://github.com/component/.downloader.js", url)
})
it("works with -", function () {
var url = getUrl("component/-dow-nloader.j-s")
assert.equal("git://github.com/component/-dow-nloader.j-s", url)
11 years ago
})
})