Permalink
Browse files

Use expect.js instead of should

  • Loading branch information...
1 parent a776732 commit 607a6dfcbe0c67b332779170ce7f248de17535b1 @JacksonTian committed Nov 25, 2014
Showing with 34 additions and 36 deletions.
  1. +1 −1 package.json
  2. +10 −11 test/doxmate-build.js
  3. +21 −22 test/doxmate-theme.js
  4. +2 −2 test/index.js
View
@@ -23,7 +23,7 @@
"ncp": "*"
},
"devDependencies": {
- "should": "*",
+ "expect.js": "*",
"mocha": "*"
},
"author": "Jackson Tian",
View
@@ -4,39 +4,38 @@
* @version: 1.0
* To change this template use File | Settings | File Templates.
*/
-
-
var exec = require('child_process').exec;
-var should = require('should');
+var expect = require('expect.js');
+
describe('doxmate build', function () {
it('build default', function (done) {
exec('cd ' + __dirname + '/example' + ' && node ' + __dirname + '/../bin/doxmate build', function (err, stdout) {
- should.not.exist(err);
- should.exist(stdout);
+ expect(err).not.to.be.ok();
+ expect(stdout).to.be.ok();
done();
});
});
it('build custom output file', function (done) {
exec('cd ' + __dirname + '/example' + ' && node ' + __dirname + '/../bin/doxmate build -o default', function (err, stdout) {
- should.not.exist(err);
- should.exist(stdout);
+ expect(err).not.to.be.ok();
+ expect(stdout).to.be.ok();
done();
});
});
it('build pomelo theme', function (done) {
exec('cd ' + __dirname + '/example' + ' && node ' + __dirname + '/../bin/doxmate build -o pomelo -s pomelo', function (err, stdout) {
- should.not.exist(err);
- should.exist(stdout);
+ expect(err).not.to.be.ok();
+ expect(stdout).to.be.ok();
done();
});
});
it('build wordpress theme', function (done) {
exec('cd ' + __dirname + '/example' + ' && node ' + __dirname + '/../bin/doxmate build -o wordpress -s wordpress', function (err, stdout) {
- should.not.exist(err);
- should.exist(stdout);
+ expect(err).not.to.be.ok();
+ expect(stdout).to.be.ok();
done();
});
});
View
@@ -4,50 +4,49 @@
* @version: 1.0
* To change this template use File | Settings | File Templates.
*/
-
-
var exec = require('child_process').exec;
-var should = require('should');
+var expect = require('expect.js');
+
describe('doxmate theme', function () {
it('should show default themes', function (done) {
exec('node ' + __dirname + '/../bin/doxmate theme list', function (err, stdout) {
- should.not.exist(err);
- stdout.should.include('default');
- stdout.should.include('pomelo');
- stdout.should.include('wordpress');
+ expect(err).not.to.be.ok();
+ expect(stdout).to.contain('default');
+ expect(stdout).to.contain('pomelo');
+ expect(stdout).to.contain('wordpress');
done();
});
});
it('should export theme ok', function (done) {
exec('cd ' + __dirname + '/example' + ' && node ' + __dirname + '/../bin/doxmate theme export', function (err, stdout) {
- should.not.exist(err);
- stdout.should.include('Exported at ');
- stdout.should.include('You can edit ');
- stdout.should.include('default');
- stdout.should.include(' for custom theme style.');
+ expect(err).not.to.be.ok();
+ expect(stdout).to.contain('Exported at ');
+ expect(stdout).to.contain('You can edit ');
+ expect(stdout).to.contain('default');
+ expect(stdout).to.contain(' for custom theme style.');
done();
});
});
it('should export theme pomelo ok', function (done) {
exec('cd ' + __dirname + '/example' + ' && node ' + __dirname + '/../bin/doxmate theme export -s pomelo', function (err, stdout) {
- should.not.exist(err);
- stdout.should.include('Exported at ');
- stdout.should.include('You can edit ');
- stdout.should.include('pomelo');
- stdout.should.include(' for custom theme style.');
+ expect(err).not.to.be.ok();
+ expect(stdout).to.contain('Exported at ');
+ expect(stdout).to.contain('You can edit ');
+ expect(stdout).to.contain('pomelo');
+ expect(stdout).to.contain(' for custom theme style.');
done();
});
});
it('should export themes wordpress ok', function (done) {
exec('cd ' + __dirname + '/example' + ' && node ' + __dirname + '/../bin/doxmate theme export -s wordpress', function (err, stdout) {
- should.not.exist(err);
- stdout.should.include('Exported at ');
- stdout.should.include('You can edit ');
- stdout.should.include('wordpress');
- stdout.should.include(' for custom theme style.');
+ expect(err).not.to.be.ok();
+ expect(stdout).to.contain('Exported at ');
+ expect(stdout).to.contain('You can edit ');
+ expect(stdout).to.contain('wordpress');
+ expect(stdout).to.contain(' for custom theme style.');
done();
});
});
View
@@ -1,7 +1,7 @@
var doxmate = require('../');
-var should = require('should');
var path = require('path');
var fs = require('fs');
+var expect = require('expect.js');
describe("Doxmate", function () {
it("getIndexs", function () {
@@ -23,6 +23,6 @@ describe("Doxmate", function () {
{ level: 2, title: 'License (MIT)' },
{ level: 2, title: "捐赠" }
];
- titles.should.eql(except);
+ expect(titles).to.eql(except);
});
});

0 comments on commit 607a6df

Please sign in to comment.