Merge "Using the --non-interactive flag now force-overwrites files."

This commit is contained in:
Jenkins
2016-05-23 20:30:54 +00:00
committed by Gerrit Code Review
2 changed files with 16 additions and 0 deletions

View File

@@ -19,6 +19,9 @@
// Add support for a `--non-interactive` flag
this.option('non-interactive');
// If non-interactive is set, force-override all files.
this.conflicter.force = this.options['non-interactive'];
},
initializing: function () {

View File

@@ -25,6 +25,7 @@
});
helpers.run(generator)
.withArguments(['--non-interactive'])
.on('end', function () {
spies.forEach(function (spy) {
expect(spy.calls.any()).toBeTruthy();
@@ -34,6 +35,18 @@
});
});
it('should force overwrite if --non-interactive is set.',
function (done) {
helpers.run(generator)
.withArguments(['--non-interactive'])
.on('ready', function (generator) {
expect(generator.conflicter.force).toBeTruthy();
})
.on('end', function () {
done();
});
});
describe('writing()', function () {
it('should create all files created in the project builder',
function (done) {