-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
return string by default and add extra method for returning buffer
- Loading branch information
1 parent
0ec4bd2
commit 665c240
Showing
5 changed files
with
44 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
var equal = require('buffer-equal'); | ||
var test = require('ava'); | ||
var stdin = require('./'); | ||
|
||
test('get stdin as a buffer', function (t) { | ||
t.plan(2); | ||
|
||
stdin.buffer(function (data) { | ||
t.assert(equal(data, new Buffer('unicorns\n'))); | ||
t.assert(data.toString().trim() === 'unicorns'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
'use strict'; | ||
var equal = require('buffer-equal'); | ||
var test = require('ava'); | ||
var stdin = require('./'); | ||
|
||
test('should get stdin', function (t) { | ||
t.plan(2); | ||
test('get stdin', function (t) { | ||
t.plan(1); | ||
|
||
stdin(function (data) { | ||
t.assert(equal(data, new Buffer('unicorns\n'))); | ||
t.assert(data.toString().trim() === 'unicorns'); | ||
t.assert(data.trim() === 'unicorns'); | ||
}); | ||
}); |