Type/what consistency for shorthands and cases
This commit is contained in:
@@ -13,10 +13,10 @@ describe('Operation', function() {
|
||||
it('operation', function() {
|
||||
// without choices, it's the same as op_prefix
|
||||
o.operation('arst').should.deep.equal({name: 'arst', operation: 'add'})
|
||||
// with choices, it propagates type where it found the name
|
||||
o.operation('arst', {bad: [], good: ['arst']}).should.deep.equal({name: 'arst', operation: 'add', type: 'good'})
|
||||
// with choices, it propagates the "what" from where it found the name
|
||||
o.operation('arst', {bad: [], good: ['arst']}).should.deep.equal({name: 'arst', operation: 'add', what: 'good'})
|
||||
// it also respects order when overridden
|
||||
o.operation('arst', {first: ['arst'], second: ['arst']}, ['second', 'first']).should.deep.equal({name: 'arst', operation: 'add', type: 'second'})
|
||||
o.operation('arst', {first: ['arst'], second: ['arst']}, ['second', 'first']).should.deep.equal({name: 'arst', operation: 'add', what: 'second'})
|
||||
})
|
||||
|
||||
})
|
||||
Reference in New Issue
Block a user