Created
November 29, 2015 19:01
-
-
Save xseignard/19be62730dc4629487ed to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| var chai = require('chai'), | |
| should = chai.should(), | |
| sinon = require('sinon'), | |
| sinonChai = require('sinon-chai'), | |
| proc = require('child_process'), | |
| shutdown = require('../../src/tools/shutdown.js'); | |
| chai.use(sinonChai); | |
| describe('shutdown()', function(){ | |
| beforeEach(function(){ | |
| sinon.stub(proc, 'exec'); | |
| }); | |
| afterEach(function(){ | |
| proc.exec.restore(); | |
| }); | |
| it('should call sync then shutdown shell cmd', function(){ | |
| var cbSpy = sinon.spy(); | |
| shutdown(cbSpy); | |
| proc.exec.should.be.called; | |
| proc.exec.invokeCallback(); | |
| cbSpy.should.be.called; | |
| }); | |
| }); |
xseignard
commented
Nov 29, 2015
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment