Comparing version 2.0.0 to 2.1.1
@@ -8,3 +8,5 @@ module.exports = { | ||
env: require('./lib/env'), | ||
beep: require('./lib/beep') | ||
beep: require('./lib/beep'), | ||
isStream: require('./lib/isStream'), | ||
isBuffer: require('./lib/isBuffer') | ||
}; |
{ | ||
"name": "gulp-util", | ||
"description": "Utility functions for gulp plugins", | ||
"version": "2.0.0", | ||
"version": "2.1.1", | ||
"homepage": "http://github.com/wearefractal/gulp-util", | ||
@@ -17,3 +17,4 @@ "repository": "git://github.com/wearefractal/gulp-util.git", | ||
"mocha": "*", | ||
"should": "*" | ||
"should": "*", | ||
"event-stream": "*" | ||
}, | ||
@@ -20,0 +21,0 @@ "scripts": { |
@@ -53,2 +53,10 @@ ![status](https://secure.travis-ci.org/wearefractal/gulp-util.png?branch=master) | ||
### isStream(obj) | ||
Returns true or false if an object is a stream. | ||
### isBuffer(obj) | ||
Returns true or false if an object is a Buffer. | ||
### template(string[, data]) | ||
@@ -55,0 +63,0 @@ |
var util = require('../'); | ||
var should = require('should'); | ||
var path = require('path'); | ||
var es = require('event-stream'); | ||
require('mocha'); | ||
@@ -164,2 +165,25 @@ | ||
describe('isStream()', function(){ | ||
it('should work on a stream', function(done){ | ||
util.isStream(es.map(function(){})).should.equal(true); | ||
done(); | ||
}); | ||
it('should not work on a buffer', function(done){ | ||
util.isStream(new Buffer('huh')).should.equal(false); | ||
done(); | ||
}); | ||
}); | ||
describe('isBuffer()', function(){ | ||
it('should work on a buffer', function(done){ | ||
util.isBuffer(new Buffer('huh')).should.equal(true); | ||
done(); | ||
}); | ||
it('should not work on a stream', function(done){ | ||
util.isBuffer(es.map(function(){})).should.equal(false); | ||
done(); | ||
}); | ||
}); | ||
}); |
12123
16
219
101
3