Skip to content

Commit

Permalink
Updated to latest yeoman-assert
Browse files Browse the repository at this point in the history
  • Loading branch information
sondr3 committed Sep 8, 2015
1 parent 684a734 commit 66e686e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"istanbul": "^0.3.17",
"mocha": "^2.2.5",
"mocha-lcov-reporter": "^0.0.2",
"yeoman-assert": "^2.0.0",
"yeoman-assert": "^2.1.0",
"yo": "^1.4.7"
}
}
19 changes: 2 additions & 17 deletions test/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@ var assert = require('yeoman-assert');
var helpers = require('yeoman-generator').test;
var fs = require('fs');

function assertObjectContains(obj, content) {
Object.keys(content).forEach(function (key) {
if (typeof content[key] === 'object') {
assertObjectContains(content[key], obj[key]);
} else {
assert.equal(content[key], obj[key]);
}
});
}

function assertJSONFileContains(filename, content) {
var obj = JSON.parse(fs.readFileSync(filename, 'utf8'));
assertObjectContains(obj, content);
}

describe('jekyllized:app', function () {
describe('running on new project', function () {
before(function (done) {
Expand Down Expand Up @@ -75,7 +60,7 @@ describe('jekyllized:app', function () {

it('creates package.json', function () {
assert.file('package.json');
assertJSONFileContains('package.json', {
assert.JSONFileContent('package.json', {
name: this.answers.projectName,
version: '0.0.0',
description: this.answers.projectDescription,
Expand Down Expand Up @@ -115,7 +100,7 @@ describe('jekyllized:app', function () {

it('extends package.json', function () {
var pkg = _.extend({name: 'jekyllized'}, this.pkg);
assertJSONFileContains('package.json', pkg);
assert.JSONFileContent('package.json', pkg);
});
});
});

0 comments on commit 66e686e

Please sign in to comment.