Find file
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (23 sloc) 1.09 KB
argon = require './lib/argon'
err = (require 'err').instance 'argon'
assert = require 'assert'
argonOut = (require 'styout').instance 'argon'
argonOut.verbosity = -1
concatenate = (paths, options) ->
[paths, {options, callbacks}] = argon.ize arguments,
name: 'concatenate'
requiredArgs: ['file/dir path(s)']
events: ['onSuccess', 'onFail']
defaultOptions: minify: false, target: ''
assert.ok arguments[0] instanceof Array, 'arguments[0] should always be an array'
assert.ok paths instanceof Array, 'paths should equal arguments[0]'
assert.ok 'onSuccess' of callbacks, 'callbacks[onSuccess] should exist'
assert.ok 'onFail' of callbacks, 'callbacks[onFail] should exist'
assert.ok 'onSuccess' not of options, 'options[onSuccess] should not exist'
assert.ok 'onFail' not of options, 'options[onFail] should not exist'
assert.throws (-> concatenate()), err.getClass('IllegalArgument'), 'Should throw an IllegalArgument error'
assert.doesNotThrow ->
concatenate ['src']
concatenate 'src'
concatenate 'src', onSuccess: -> 'Woo'
console.log 'All tests passed.'