Skip to content

Commit

Permalink
Refactor testing of uploading a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
sondr3 committed May 23, 2016
1 parent fa3b95c commit 6c9b516
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/aws.js → test/uploading/aws.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var assert = require('yeoman-assert');
var helpers = require('yeoman-test');

test.before(() => {
return helpers.run(path.join(__dirname, '../generators/gulp'))
return helpers.run(path.join(__dirname, '../../generators/gulp'))
.withOptions({uploading: 'Amazon S3'})
.toPromise();
});
Expand Down
2 changes: 1 addition & 1 deletion test/ghpages.js → test/uploading/ghpages.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var assert = require('yeoman-assert');
var helpers = require('yeoman-test');

test.before(() => {
return helpers.run(path.join(__dirname, '../generators/gulp'))
return helpers.run(path.join(__dirname, '../../generators/gulp'))
.withOptions({uploading: 'Github Pages'})
.toPromise();
});
Expand Down
41 changes: 41 additions & 0 deletions test/uploading/none.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
'use strict';
var path = require('path');
var test = require('ava');
var assert = require('yeoman-assert');
var helpers = require('yeoman-test');

test.before(() => {
return helpers.run(path.join(__dirname, '../../generators/gulp'))
.withOptions({uploading: 'None'})
.toPromise();
});

test('creates gulpfile', () => {
assert.file('gulpfile.js');
});

test('creates package.json file', () => {
assert.file('package.json');
});

test('does not create credentials files', () => {
assert.noFile([
'aws-credentials.json',
'rsync-credentials.json'
]);
});

test('does not contain uploading packages', () => {
[
'"gulp-awspublish"',
'"concurrent-transform"',
'"gulp-rsync"',
'"gulp-gh-pages"'
].forEach(pack => {
assert.noFileContent('package.json', pack);
});
});

test('does not contain deploy task', () => {
assert.noFileContent('gulpfile.js', 'gulp.task(\'deploy\'');
});
2 changes: 1 addition & 1 deletion test/rsync.js → test/uploading/rsync.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var assert = require('yeoman-assert');
var helpers = require('yeoman-test');

test.before(() => {
return helpers.run(path.join(__dirname, '../generators/gulp'))
return helpers.run(path.join(__dirname, '../../generators/gulp'))
.withOptions({uploading: 'Rsync'})
.toPromise();
});
Expand Down

0 comments on commit 6c9b516

Please sign in to comment.