Skip to content

Commit

Permalink
test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschlinkert committed Mar 28, 2015
1 parent 2306e5d commit 7679698
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
12 changes: 12 additions & 0 deletions .verb.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ Seems like every lib I've found does too much, like both stringifying and parsin

```js
var gh = require('{%= name %}');
gh('https://github.com/jonschlinkert/micromatch');
```

Results in:

```js
{
"user": "jonschlinkert",
"repo": "micromatch",
"repopath": "jonschlinkert/micromatch",
"branch": "master"
}
```

## Example results
Expand Down
28 changes: 22 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# parse-github-url [![NPM version](https://badge.fury.io/js/parse-github-url.svg)](http://badge.fury.io/js/parse-github-url) [![Build Status](https://travis-ci.org/jonschlinkert/parse-github-url.svg)](https://travis-ci.org/jonschlinkert/parse-github-url)


> Parse a github URL into an object.
**Why another GitHub URL parser library?**
Expand All @@ -16,6 +17,18 @@ npm i parse-github-url --save

```js
var gh = require('parse-github-url');
gh('https://github.com/jonschlinkert/micromatch');
```

Results in:

```js
{
"user": "jonschlinkert",
"repo": "micromatch",
"repopath": "jonschlinkert/micromatch",
"branch": "master"
}
```

## Example results
Expand Down Expand Up @@ -297,29 +310,32 @@ Generated results from test fixtures:
```

## Related projects
* [is-git-url](https://github.com/jonschlinkert/is-git-url): Regex to validate that a URL is a git url.
[is-git-url](https://github.com/jonschlinkert/is-git-url): Regex to validate that a URL is a git url.

## Running tests
Install dev dependencies.
Install dev dependencies:

```bash
npm i -d && npm test
```


## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/parse-github-url/issues)


## Author

**Jon Schlinkert**

+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)


## License
Copyright (c) 2015 Jon Schlinkert
Released under the MIT license

***

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 14, 2015._
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 25, 2015._
2 changes: 2 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ var o;
describe('parse-github-url', function () {
it('should get the user:', function () {
assert.equal(gh(''), null);
assert.equal(gh('https://github.com/jonschlinkert/micromatch').user, 'jonschlinkert');
assert.equal(gh('[email protected]:assemble/verb.git').user, 'assemble');
assert.equal(gh('assemble/verb#branch').user, 'assemble');
assert.equal(gh('assemble/verb#dev').user, 'assemble');
assert.equal(gh('assemble/verb').user, 'assemble');
Expand Down

0 comments on commit 7679698

Please sign in to comment.