Skip to content

Commit

Permalink
update descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
tunnckoCore committed Oct 1, 2015
1 parent a9a822c commit 5b1ca83
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [coone][author-www-url] [![npmjs.com][npmjs-img]][npmjs-url] [![The MIT License][license-img]][license-url]

> Acts like [co@3](https://github.com/tj/co/tree/93fd2bb5e8803fdde15d95b3025b0b134904f4dc), on top of [always-done](https://github.com/hybridables/always-done). But accept everything, not only generators - sync functions, async functions, callbacks and more. Flow-control for now and then.
> Acts like [co@4](https://github.com/tj/co/tree/93fd2bb5e8803fdde15d95b3025b0b134904f4dc) and also is drop-in replacement for it. Built on top of [merz](https://github.com/hybridables/merz), actually thanks to [always-done](https://github.com/hybridables/always-done). But accept everything, not only generators - sync functions, async functions, callbacks and more. Flow-control for now and then.
[![code climate][codeclimate-img]][codeclimate-url] [![standard code style][standard-img]][standard-url] [![travis build status][travis-img]][travis-url] [![coverage status][coveralls-img]][coveralls-url] [![dependency status][david-img]][david-url]

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "coone",
"version": "0.0.0",
"description": "Acts like `co3`, on top of `always-done`. But accept everything, not only generators - sync functions, async functions, callbacks and more. Flow-control for now and then.",
"description": "Acts like `co@3` and also is drop-in replacement for it. Built on top of `merz`, actually thanks to `always-done`. But accept everything, not only generators - sync functions, async functions, callbacks and more. Flow-control for now and then.",
"repository": "hybridables/coone",
"author": "Charlike Mike Reagent <@tunnckoCore> (http://www.tunnckocore.tk)",
"main": "index.js",
Expand All @@ -18,6 +18,7 @@
"bluebird": "^2.10.1",
"mz": "^2.0.0",
"rx": "^4.0.0",
"semver": "^5.0.3",
"simple-get": "^1.4.3",
"through2": "^2.0.0"
},
Expand Down
8 changes: 8 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
'use strict'

var test = require('assertit')
var semver = require('semver')

test('errors', function (done) {
require('./test/errors')
Expand Down Expand Up @@ -45,3 +46,10 @@ test('child processes', function (done) {
require('./test/child_processes')
done()
})

if (semver.gte(process.version, '0.11.13')) {
test('generators', function (done) {
require('./test/generators')
done()
})
}
41 changes: 41 additions & 0 deletions test/generators.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*!
* coone <https://github.com/hybridables/coone>
*
* Copyright (c) 2015 Charlike Mike Reagent <@tunnckoCore> (http://www.tunnckocore.tk)
* Released under the MIT license.
*/

/* jshint asi:true */

'use strict'

var mzfs = require('mz/fs')
var test = require('assertit')
var coone = require('../index')

function * success () {
return yield mzfs.readFile('package.json', 'utf8')
}

function * failure () {
return yield mzfs.readFile('foobar.json')
}

test('should handle successful generator function', function (done) {
coone(success)(function (err, res) {
test.ifError(err)
test.strictEqual(typeof res, 'string')
test.ok(res.indexOf('"license": "MIT"') !== -1)
done()
})
})

test('should handle generator function errors', function (done) {
coone(failure)(function (err, res) {
test.ifError(!err)
test.ok(err instanceof Error)
test.strictEqual(err.code, 'ENOENT')
test.strictEqual(res, undefined)
done()
})
})

0 comments on commit 5b1ca83

Please sign in to comment.