Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

First round of tests (#3)

  • Loading branch information...
commit a8a3742d22d090360cd7613c7451a5589f2b4daf 1 parent 8b3c086
@passy passy authored
Showing with 78 additions and 1 deletion.
  1. +19 −0 .jshintrc
  2. +2 −1  .travis.yml
  3. +57 −0 test/test.js
View
19 .jshintrc
@@ -0,0 +1,19 @@
+{
+ "node": true,
+ "es5": true,
+ "esnext": true,
+ "bitwise": false,
+ "curly": false,
+ "eqeqeq": true,
+ "eqnull": true,
+ "immed": true,
+ "latedef": true,
+ "newcap": true,
+ "noarg": true,
+ "undef": true,
+ "strict": false,
+ "trailing": true,
+ "smarttabs": true,
+ "indent": 2,
+ "white": true
+}
View
3  .travis.yml
@@ -1,3 +1,4 @@
language: node_js
node_js:
- - 0.8
+ - '0.8'
+ - '0.10'
View
57 test/test.js
@@ -0,0 +1,57 @@
+/*global describe, beforeEach, it*/
+'use strict';
+
+var path = require('path');
+var helpers = require('yeoman-generator').test;
+var assert = require('assert');
+
+
+describe('Bootstrap generator test', function () {
+ beforeEach(function (done) {
+ helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
+ if (err) {
+ return done(err);
+ }
+
+ this.webapp = helpers.createGenerator('bootstrap:app', [
+ '../../app'
+ ]);
+ done();
+ }.bind(this));
+ });
+
+ it('the generator can be required without throwing', function () {
+ // not testing the actual run of generators yet
+ this.app = require('../app');
+ });
+
+ it('creates expected files in compass mode', function (done) {
+ var expected = [
+ 'app/styles/main.scss'
+ ];
+
+ helpers.mockPrompt(this.webapp, {
+ 'compassBootstrap': 'Y'
+ });
+
+ this.webapp.run({}, function () {
+ helpers.assertFiles(expected);
+ done();
+ });
+ });
+
+ it('creates expected files in vanilla mode', function (done) {
+ var expected = [
+ 'app/styles/bootstrap.css'
+ ];
+
+ helpers.mockPrompt(this.webapp, {
+ 'compassBootstrap': 'N'
+ });
+
+ this.webapp.run({}, function () {
+ helpers.assertFiles(expected);
+ done();
+ });
+ });
+});
Please sign in to comment.
Something went wrong with that request. Please try again.