Permalink
Browse files

Add tests

  • Loading branch information...
1 parent 00ab6bd commit e05ee944561946c478c7acbb5a681833d34f6f10 @sindresorhus sindresorhus committed Mar 3, 2013
Showing with 40 additions and 2 deletions.
  1. +1 −0 .gitignore
  2. +1 −1 package.json
  3. +1 −1 readme.md
  4. +37 −0 test/test-file-creation.js
View
@@ -1,2 +1,3 @@
node_modules
app/templates
+test/temp
View
@@ -23,7 +23,7 @@
"url": "git://github.com/sindresorhus/generator-server-configs.git"
},
"scripts": {
- "test": "mocha test/test-*.js"
+ "test": "mocha test/test-*.js --timeout 50000"
},
"dependencies": {
"yeoman-generator": "~0.10.2",
View
@@ -1,4 +1,4 @@
-# H5BP Server Configs generator
+# H5BP Server Configs generator [![Build Status](https://secure.travis-ci.org/sindresorhus/generator-server-configs.png?branch=master)](http://travis-ci.org/sindresorhus/generator-server-configs)
Scaffolds out [webserver configuration](https://github.com/h5bp/server-configs) for various platforms. Goes well with HTML5 Boilerplate.
@@ -0,0 +1,37 @@
+/*global describe beforeEach it */
+'use strict';
+var path = require('path');
+var helpers = require('yeoman-generator').test;
+
+describe('H5BP Server Configs generator', function () {
+ beforeEach(function (cb) {
+ var deps = ['../../app'];
+
+ helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
+ if (err) {
+ return cb(err);
+ }
+
+ this.generator = helpers.createGenerator('server-configs:app', deps);
+ cb();
+ }.bind(this));
+ });
+
+ it('`node` options generates expected files', function (cb) {
+ var expected = ['package.json'];
+
+ this.generator.run(['node'], function () {
+ helpers.assertFiles(expected);
+ cb();
+ });
+ });
+
+ it('`apache` options generates expected files', function (cb) {
+ var expected = ['.htaccess'];
+
+ this.generator.run(['apache'], function () {
+ helpers.assertFiles(expected);
+ cb();
+ });
+ });
+});

0 comments on commit e05ee94

Please sign in to comment.