From b5e9bb9e6a270d2d16081d54a2ed573bc714702b Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 7 Sep 2016 14:40:18 -0700 Subject: [PATCH] Add spec for accessing process.stdin --- spec/node-spec.js | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/spec/node-spec.js b/spec/node-spec.js index 9382c4c9154..87903bbfb8c 100644 --- a/spec/node-spec.js +++ b/spec/node-spec.js @@ -221,12 +221,16 @@ describe('node feature', function () { }) describe('process.stdout', function () { - it('should not throw exception', function () { - process.stdout + it('does not throw an exception when accessed', function () { + assert.doesNotThrow(function () { + process.stdout + }) }) - it('should not throw exception when calling write()', function () { - process.stdout.write('test') + it('does not throw an exception when calling write()', function () { + assert.doesNotThrow(function () { + process.stdout.write('test') + }) }) it('should have isTTY defined', function () { @@ -236,6 +240,20 @@ describe('node feature', function () { }) }) + describe('process.stdin', function () { + it('does not throw an exception when accessed', function () { + assert.doesNotThrow(function () { + process.stdin + }) + }) + + it('does not throw an exception when calling read()', function () { + assert.doesNotThrow(function () { + assert.equal(process.stdin.read(), null) + }) + }) + }) + describe('process.version', function () { it('should not have -pre', function () { assert(!process.version.endsWith('-pre'))