Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changed API to allow for easier extension.

Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>
  • Loading branch information...
commit 783a57f074d9f25f687ccb00b5bfcb8ad60960d3 1 parent 5f834b5
@ncb000gt authored
View
4 lib/queuestream.js
@@ -152,7 +152,5 @@ QueueStream.prototype.currentResume = function() {
}
module.exports = {
- QueueStream: function(opts) {
- return new QueueStream(opts);
- }
+ QueueStream: QueueStream
}
View
2  package.json
@@ -1,6 +1,6 @@
{
"name": "queuestream",
- "version": "0.0.4",
+ "version": "0.0.5",
"author": "Nick Campbell (http://github.com/ncb000gt)",
"description": "Queue streams for sequential streaming.",
"main": "./lib/queuestream",
View
6 tests/test-convenience.js
@@ -4,7 +4,7 @@ var testCase = require('nodeunit').testCase,
module.exports = testCase({
"test length": function(assert) {
- var stream = QueueStream();
+ var stream = new QueueStream();
var test1 = fs.createReadStream(__dirname + '/files/test1.txt');
stream.queue(test1);
var test2 = fs.createReadStream(__dirname + '/files/test2.txt');
@@ -15,7 +15,7 @@ module.exports = testCase({
assert.done();
},
"test current": function(assert) {
- var stream = QueueStream();
+ var stream = new QueueStream();
var test1 = fs.createReadStream(__dirname + '/files/test1.txt');
stream.queue(test1);
var test2 = fs.createReadStream(__dirname + '/files/test2.txt');
@@ -29,7 +29,7 @@ module.exports = testCase({
assert.done();
},
"test queue": function(assert) {
- var stream = QueueStream();
+ var stream = new QueueStream();
var test1 = fs.createReadStream(__dirname + '/files/test1.txt');
stream.queue(test1);
var test2 = fs.createReadStream(__dirname + '/files/test2.txt');
View
18 tests/test-meat.js
@@ -4,7 +4,7 @@ var testCase = require('nodeunit').testCase,
module.exports = testCase({
"test injecting": function(assert) {
- var stream = QueueStream();
+ var stream = new QueueStream();
var test1 = fs.createReadStream(__dirname + '/files/test1.txt');
var test2 = fs.createReadStream(__dirname + '/files/test2.txt');
stream.queue(test2);
@@ -19,7 +19,7 @@ module.exports = testCase({
assert.done();
},
"test injecting nothing": function(assert) {
- var stream = QueueStream();
+ var stream = new QueueStream();
stream.inject();
assert.equal(stream.length(), 0);
@@ -30,7 +30,7 @@ module.exports = testCase({
assert.done();
},
"test injecting array": function(assert) {
- var stream = QueueStream();
+ var stream = new QueueStream();
var test0 = fs.createReadStream(__dirname + '/files/test1.txt');
var test1 = fs.createReadStream(__dirname + '/files/test1.txt');
var test2 = fs.createReadStream(__dirname + '/files/test2.txt');
@@ -47,7 +47,7 @@ module.exports = testCase({
assert.done();
},
"test queuing": function(assert) {
- var stream = QueueStream();
+ var stream = new QueueStream();
var test1 = fs.createReadStream(__dirname + '/files/test1.txt');
stream.queue(test1);
@@ -59,7 +59,7 @@ module.exports = testCase({
assert.done();
},
"test queuing nothing": function(assert) {
- var stream = QueueStream();
+ var stream = new QueueStream();
stream.queue();
assert.equal(stream.length(), 0);
@@ -70,7 +70,7 @@ module.exports = testCase({
assert.done();
},
"test queuing array": function(assert) {
- var stream = QueueStream();
+ var stream = new QueueStream();
var test0 = fs.createReadStream(__dirname + '/files/test1.txt');
var test1 = fs.createReadStream(__dirname + '/files/test1.txt');
var test2 = fs.createReadStream(__dirname + '/files/test2.txt');
@@ -89,7 +89,7 @@ module.exports = testCase({
"test data emits": function(assert) {
assert.expect(6);
var count = 0;
- var stream = QueueStream();
+ var stream = new QueueStream();
stream.on('error', function(err) {
console.log('err: ' + err);
@@ -116,7 +116,7 @@ module.exports = testCase({
"test data emits with small buffers": function(assert) {
assert.expect(12);
var count = 0;
- var stream = QueueStream();
+ var stream = new QueueStream();
stream.on('error', function(err) {
console.log('err: ' + err);
@@ -143,7 +143,7 @@ module.exports = testCase({
"test next": function(assert) {
assert.expect(6);
var count = 0;
- var stream = QueueStream();
+ var stream = new QueueStream();
var test1 = fs.createReadStream(__dirname + '/files/test1.txt');
stream.queue(test1);
Please sign in to comment.
Something went wrong with that request. Please try again.