Skip to content

Commit 3c52df0

Browse files
committed
Merge pull request #10 from hariadi/develop
v0.2.6
2 parents cc265a7 + 8058479 commit 3c52df0

File tree

4 files changed

+39
-42
lines changed

4 files changed

+39
-42
lines changed

app/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ var MetalsmithGenerator = yeoman.generators.Base.extend({
1010
this.on('end', function () {
1111
this.installDependencies({
1212
skipInstall: this.options['skip-install'] || this.options.s,
13+
bower: false,
1314
callback: function () {
1415
this.spawnCommand('make', ['build']);
1516
}.bind(this)
@@ -64,7 +65,7 @@ var MetalsmithGenerator = yeoman.generators.Base.extend({
6465
type : 'input',
6566
name : 'msAuthor',
6667
message : 'Author name',
67-
default : this.user.git.username || 'Metal Smith'
68+
default : this.user.git.name() || 'Metal Smith'
6869
}, {
6970
type : 'input',
7071
name : 'msGithubUser',

app/templates/_package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"metalsmith-templates": "^0.5.2",
1717
"<%= templateEngine %>": "<%= metalsmith.engine[templateEngine] %>",<% } %><% if(markdown){ %>
1818
"metalsmith-markdown": "^0.2.1",<% } %><% if(permalinks){ %>
19-
"metalsmith-permalinks": "^0.3.2",<% } %><% if(collections){ %>
20-
"metalsmith-collections": "^0.4.1",<% } %>
21-
"metalsmith": "^0.9.0"
19+
"metalsmith-permalinks": "^0.4.0",<% } %><% if(collections){ %>
20+
"metalsmith-collections": "^0.6.0",<% } %>
21+
"metalsmith": "^0.10.0"
2222
}
2323
}

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "generator-metalsmith",
3-
"version": "0.2.5",
3+
"version": "0.2.6",
44
"homepage": "https://github.com/hariadi/generator-metalsmith",
55
"description": "Yeoman generator for Metalsmith",
66
"author": {
@@ -16,7 +16,6 @@
1616
"bugs": {
1717
"url": "https://github.com/hariadi/generator-metalsmith/issues"
1818
},
19-
2019
"engines": {
2120
"node": ">=0.10.0"
2221
},
@@ -27,7 +26,7 @@
2726
"app"
2827
],
2928
"dependencies": {
30-
"yeoman-generator": "~0.16.0"
29+
"yeoman-generator": "^0.17.5"
3130
},
3231
"devDependencies": {
3332
"mocha": "*"

test/test-creation.js

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,42 @@
11
/*global describe, beforeEach, it */
22
'use strict';
3+
34
var path = require('path');
5+
var assert = require('yeoman-generator').assert;
46
var helpers = require('yeoman-generator').test;
57

68
describe('metalsmith generator', function () {
7-
beforeEach(function (done) {
8-
helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
9-
if (err) {
10-
return done(err);
11-
}
129

13-
this.app = helpers.createGenerator('metalsmith:app', [
14-
'../../app'
15-
]);
16-
done();
17-
}.bind(this));
10+
before(function (done) {
11+
helpers.run(path.join(__dirname, '../app'))
12+
.inDir(path.join(__dirname, './temp'))
13+
.withOptions({
14+
'skip-install-message': true,
15+
'skip-install': true,
16+
'skip-welcome-message': true,
17+
'skip-message': true
18+
})
19+
.withPrompt({
20+
msTitle: 'Metalsmith Blog',
21+
msDesc: 'My Metalsmith-Powered Site',
22+
msAuthor: 'Metal Smith',
23+
msGithubUser: 'metalsmith',
24+
msPlugins: [
25+
'metalsmith-ignore',
26+
'metalsmith-drafts',
27+
'metalsmith-templates',
28+
'metalsmith-markdown',
29+
'metalsmith-permalinks',
30+
'metalsmith-collections'
31+
],
32+
templateEngine: 'swig',
33+
permalinksPattern: ':title',
34+
})
35+
.on('end', done);
1836
});
1937

20-
it('creates expected files', function (done) {
21-
var expected = [
38+
it('creates files', function () {
39+
assert.file([
2240
'_layouts/post.html',
2341
'_posts/2012-08-20-first-post.md',
2442
'_posts/2012-08-23-second-post.md',
@@ -29,28 +47,7 @@ describe('metalsmith generator', function () {
2947
'metalsmith.json',
3048
'Makefile',
3149
'README.md'
32-
];
33-
34-
helpers.mockPrompt(this.app, {
35-
msTitle: 'Metalsmith Blog',
36-
msDesc: 'My Metalsmith-Powered Site',
37-
msAuthor: 'Metal Smith',
38-
msGithubUser: 'metalsmith',
39-
msPlugins: [
40-
'metalsmith-ignore',
41-
'metalsmith-drafts',
42-
'metalsmith-templates',
43-
'metalsmith-markdown',
44-
'metalsmith-permalinks',
45-
'metalsmith-collections'
46-
],
47-
templateEngine: 'swig',
48-
permalinksPattern: ':title',
49-
});
50-
this.app.options['skip-install'] = true;
51-
this.app.run({}, function () {
52-
helpers.assertFile(expected);
53-
done();
54-
});
50+
]);
5551
});
52+
5653
});

0 commit comments

Comments
 (0)