Skip to content

Commit

Permalink
Merge 2bb89a6 into f5dd23b
Browse files Browse the repository at this point in the history
  • Loading branch information
weklund committed Oct 19, 2016
2 parents f5dd23b + 2bb89a6 commit 2da753b
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"devDependencies": {
"assert": "^1.4.1",
"chai": "^3.5.0",
"chai-spies": "^0.7.1",
"coveralls": "^2.11.14",
"istanbul": "^0.4.5",
"mocha": "^3.1.2",
Expand Down
11 changes: 11 additions & 0 deletions src/TearDownCommand.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class TearDownCommand {
constructor() {

}

run() {

}
}

module.exports.TearDownCommand = TearDownCommand;
1 change: 0 additions & 1 deletion test/DriverLocatorTest.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
let expect = require('chai').expect;
let fs = require('fs');
let mockeryPartial = require('mockery-partial');
let DriverLocator = require('../src/DriverLocator');
let ContactDriver = require('./MockDrivers/ContactDriver').ContactDriver;
let EventDriver = require('./MockDrivers/EventDriver').EventDriver;
Expand Down
43 changes: 43 additions & 0 deletions test/TearDownCommandTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
'use strict'

let chai = require('chai');
let spies = require('chai-spies');

chai.use(spies);

let should = chai.should();
let expect = chai.expect;

let TearDownCommand = require('../src/TearDownCommand').TearDownCommand;

describe('Tear down command tests', () => {
it('should destroy all the objects in the dependency chain',() => {

let accountDriverSpy = chai.spy.object(['tearDown']);
let contactDriverSpy = chai.spy.object(['tearDown']);

let drivers = {
'account': accountDriverSpy,
'contact': contactDriverSpy
};

let driverLocator = {
drivers: function () {
return drivers;
}
};

let fs = {};

let tearDownCommand = new TearDownCommand(
'./path/to/seed.json',
driverLocator,
fs
);

tearDownCommand.run();

accountDriverSpy.should.have.been.called.once;
contactDriverSpy.should.have.been.called.once;
});
});

0 comments on commit 2da753b

Please sign in to comment.