[Pkg-javascript-commits] [node-mocks-http] 166/296: added; tests for mockWritableStream
Thorsten Alteholz
alteholz at moszumanska.debian.org
Mon Feb 8 18:13:32 UTC 2016
This is an automated email from the git hooks/post-receive script.
alteholz pushed a commit to branch master
in repository node-mocks-http.
commit 0c6124eb4f8fb27f593ba19fde55d0d6ef944547
Author: Johnny Estilles <johnny.estilles at agentia.asia>
Date: Mon Apr 6 15:06:17 2015 +0800
added; tests for mockWritableStream
---
test/lib/mockWritableStream.spec.js | 45 +++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/test/lib/mockWritableStream.spec.js b/test/lib/mockWritableStream.spec.js
new file mode 100644
index 0000000..f382b22
--- /dev/null
+++ b/test/lib/mockWritableStream.spec.js
@@ -0,0 +1,45 @@
+'use strict';
+
+var chai = require('chai');
+var expect = chai.expect;
+
+var MockWritableStream = require('../../lib/mockWritableStream');
+var mockWritableStream;
+
+describe('mockWritableStream', function() {
+
+ before(function() {
+ mockWritableStream = new MockWritableStream();
+ });
+
+ it('should be a function', function() {
+ expect(MockWritableStream).to.be.a('function');
+ });
+
+ it('should be an object factory', function() {
+ expect(mockWritableStream).to.be.a('object');
+ expect(mockWritableStream).to.be.an.instanceof(MockWritableStream);
+ });
+
+ it('should expose "MockWritableStream" prototype', function() {
+ expect(mockWritableStream).to.have.property('writable');
+ expect(mockWritableStream.writable).to.be.a('function');
+
+ expect(mockWritableStream).to.have.property('end');
+ expect(mockWritableStream.end).to.be.a('function');
+
+ expect(mockWritableStream).to.have.property('destroy');
+ expect(mockWritableStream.destroy).to.be.a('function');
+
+ expect(mockWritableStream).to.have.property('destroySoon');
+ expect(mockWritableStream.destroySoon).to.be.a('function');
+ });
+
+ it('should return undefined when methods called', function() {
+ expect(mockWritableStream.writable()).to.be.undefined;
+ expect(mockWritableStream.end()).to.be.undefined;
+ expect(mockWritableStream.destroy()).to.be.undefined;
+ expect(mockWritableStream.destroySoon()).to.be.undefined;
+ });
+
+});
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-mocks-http.git
More information about the Pkg-javascript-commits
mailing list