Skip to content

Commit

Permalink
fix(db:seed): make sure --files accept value
Browse files Browse the repository at this point in the history
the --files flag was expecting a boolean instead it should accept value
  • Loading branch information
thetutlage committed Nov 23, 2016
1 parent 758ef01 commit 0edd6cc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Commands/Seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Seed extends Command {
* @public
*/
get signature () {
return 'db:seed {-f,--force?} {--files?}'
return 'db:seed {-f,--force?} {--files?=@value}'
}

/**
Expand Down
11 changes: 11 additions & 0 deletions test/unit/commands.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Ioc.bind('Adonis/Src/Command', function () {
return require('adonis-ace/src/Command')
})
const Refresh = require('../../src/Commands/Refresh')
const Seed = require('../../src/Commands/Seed')
const Run = require('../../src/Commands/Run')
const Rollback = require('../../src/Commands/Rollback')
const Reset = require('../../src/Commands/Reset')
Expand Down Expand Up @@ -219,4 +220,14 @@ describe('Commands', function () {
yield Database.schema.dropTable('adonis_schema')
})
})

context('Seed', function () {
it('should accept values for the files argument', function () {
const seed = new Seed()
seed.initialize()
expect(seed.options[1].name).to.equal('--files')
expect(seed.options[1].required).to.equal(false)
expect(seed.options[1].acceptsValue).to.equal(true)
})
})
})

0 comments on commit 0edd6cc

Please sign in to comment.